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.SerializableIdentifier 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.StringTYPE_SEPARATOR_PREFIXstatic java.lang.StringTYPE_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 booleanequals(java.lang.Object obj)java.lang.StringgetCode()java.lang.StringgetTypeCode()inthashCode()java.lang.Stringprint()Prints the identifier in the canonical formstatic java.lang.Stringprint(java.lang.String code, java.lang.String typeCode)Prints the identifier in the canonical formvoidsetCode(java.lang.String code)voidsetTypeCode(java.lang.String typeCode)java.lang.StringtoString()static java.lang.StringtoString(java.lang.String code, java.lang.String typeCode)Prints the identifier in the canonical formstatic MaterialIdentifiertryCreate(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 MaterialIdentifiertryParseIdentifier(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:
nullif 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:
equalsin classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-