Class LegalEntityId

  • All Implemented Interfaces:
    ReferenceDataId<LegalEntity>, Serializable

    public final class LegalEntityId
    extends Object
    implements ReferenceDataId<LegalEntity>, Serializable
    An identifier for a legal entity.

    This identifier is used to obtain a LegalEntity from ReferenceData.

    A legal entity identifier uniquely identifies a legal entity within the system. A real-world legal entity will typically have multiple identifiers. The only restriction placed on the identifier is that it is sufficiently unique for the reference data lookup. As such, it is acceptable to use an identifier from a well-known global or vendor symbology.

    See Also:
    Serialized Form
    • Method Detail

      • of

        public static LegalEntityId of​(String scheme,
                                       String value)
        Obtains an instance from a scheme and value.

        The scheme and value are used to produce a StandardId, where more information is available on how schemes and values relate to industry identifiers.

        The scheme must be non-empty and match the regular expression '[A-Za-z0-9:/+.=_-]*'. This permits letters, numbers, colon, forward-slash, plus, dot, equals, underscore and dash. If necessary, the scheme can be encoded using StandardId.encodeScheme(String).

        The value must be non-empty and match the regular expression '[!-z][ -z]*'.

        scheme - the scheme of the identifier, not empty
        value - the value of the identifier, not empty
        the security identifier
        IllegalArgumentException - if the scheme or value is invalid
      • of

        public static LegalEntityId of​(StandardId standardId)
        Creates an instance from a standard two-part identifier.
        standardId - the underlying standard two-part identifier
        the security identifier
      • parse

        public static LegalEntityId parse​(String str)
        Parses an StandardId from a formatted scheme and value.

        This parses the identifier from the form produced by toString() which is '$scheme~$value'.

        str - the identifier to parse
        the security identifier
        IllegalArgumentException - if the identifier cannot be parsed
      • getStandardId

        public StandardId getStandardId()
        Gets the standard two-part identifier.
        the standard two-part identifier
      • equals

        public boolean equals​(Object obj)
        Checks if this identifier equals another identifier.

        The comparison checks the name.

        equals in class Object
        obj - the other identifier, null returns false
        true if equal
      • hashCode

        public int hashCode()
        Returns a suitable hash code for the identifier.
        hashCode in class Object
        the hash code
      • toString

        public String toString()
        Returns the identifier in a standard string format.

        The returned string is in the form '$scheme~$value'. This is suitable for use with parse(String). For example, if the scheme is 'OG-Future' and the value is 'Eurex-FGBL-Mar14' then the result is 'OG-Future~Eurex-FGBL-Mar14'.

        toString in class Object
        a parsable representation of the identifier