Class 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 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)
    • 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 class java.lang.Object
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object