Class MaterialIdentifier
- java.lang.Object
-
- ch.systemsx.cisd.openbis.generic.shared.basic.dto.MaterialIdentifier
-
- All Implemented Interfaces:
java.io.Serializable
public final class MaterialIdentifier extends java.lang.Object implements java.io.Serializable
Identifier for searching material through Web Service lookup methods in the database.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
TYPE_SEPARATOR_PREFIX
static java.lang.String
TYPE_SEPARATOR_SUFFIX
-
Constructor Summary
Constructors Constructor Description MaterialIdentifier()
MaterialIdentifier(IEntityInformationHolderWithPermId material)
MaterialIdentifier(java.lang.String code, java.lang.String typeCode)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.lang.String
getCode()
java.lang.String
getTypeCode()
int
hashCode()
java.lang.String
print()
Prints the identifier in the canonical formstatic java.lang.String
print(java.lang.String code, java.lang.String typeCode)
Prints the identifier in the canonical formvoid
setCode(java.lang.String code)
void
setTypeCode(java.lang.String typeCode)
java.lang.String
toString()
static java.lang.String
toString(java.lang.String code, java.lang.String typeCode)
Prints the identifier in the canonical formstatic MaterialIdentifier
tryCreate(java.lang.String codeOrIdentifierOrNull, ICodeHolder materialTypeCodeHolderOrNull)
Creates material identifier from specified identifier or code and material type code if no full identifier is specified.static MaterialIdentifier
tryParseIdentifier(java.lang.String value)
Parses the material code and type.
-
-
-
Field Detail
-
TYPE_SEPARATOR_PREFIX
public static final java.lang.String TYPE_SEPARATOR_PREFIX
- See Also:
- Constant Field Values
-
TYPE_SEPARATOR_SUFFIX
public static final java.lang.String TYPE_SEPARATOR_SUFFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MaterialIdentifier
public MaterialIdentifier()
-
MaterialIdentifier
public MaterialIdentifier(java.lang.String code, java.lang.String typeCode)
-
MaterialIdentifier
public MaterialIdentifier(IEntityInformationHolderWithPermId material)
-
-
Method Detail
-
getCode
public final java.lang.String getCode()
-
setCode
public final void setCode(java.lang.String code)
-
getTypeCode
public java.lang.String getTypeCode()
-
setTypeCode
public void setTypeCode(java.lang.String typeCode)
-
tryCreate
public static MaterialIdentifier tryCreate(java.lang.String codeOrIdentifierOrNull, ICodeHolder materialTypeCodeHolderOrNull)
Creates material identifier from specified identifier or code and material type code if no full identifier is specified.- Returns:
null
if no full identifier specified and material type is unknown.
-
tryParseIdentifier
public static MaterialIdentifier tryParseIdentifier(java.lang.String value)
Parses the material code and type. Assumes the syntax: "code (type)". Returns the chosen material if parsing went ok, null otherwise.
-
print
public java.lang.String print()
Prints the identifier in the canonical form
-
print
public static java.lang.String print(java.lang.String code, java.lang.String typeCode)
Prints the identifier in the canonical form
-
toString
public static java.lang.String toString(java.lang.String code, java.lang.String typeCode)
Prints the identifier in the canonical form
-
equals
public final boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-