Class DocumentId

  • All Implemented Interfaces:
    Serializable

    public final class DocumentId
    extends Object
    implements Serializable
    An immutable representation of a box document id which includes the source name of the document and its id.
    See Also:
    Serialized Form
    • Constructor Detail

      • DocumentId

        public DocumentId​(String sourceName,
                          String id)
        Creates a new DocumentId with the given source name and id.
        Parameters:
        sourceName - the source name of the document.
        id - the id of the document.
        Throws:
        NullPointerException - if either sourceName or id is null
    • Method Detail

      • getSourceName

        public String getSourceName()
        Returns the source name.
        Returns:
        the sourceName
      • getId

        public String getId()
        Returns the id.
        Returns:
        the id
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(Object o)
        Checks equality of the source name and ID.
        Overrides:
        equals in class Object
        Parameters:
        o - the object to be compared.
        Returns:
        whether the given object is equal to this.
      • toString

        public String toString()
        Returns a string representation of this. Specifically `{sourceName}.{id}`.
        Overrides:
        toString in class Object
        Returns:
        sourceName.id