Enum Class GitObjectType

java.lang.Object
java.lang.Enum<GitObjectType>
com.atlassian.bitbucket.scm.git.GitObjectType
All Implemented Interfaces:
Serializable, Comparable<GitObjectType>, Constable

public enum GitObjectType extends Enum<GitObjectType>
Defines the types of objects which may be returned by git cat-file -t.
  • Enum Constant Details

    • BLOB

      public static final GitObjectType BLOB
      A blob, which is a file of some type.
    • COMMIT

      public static final GitObjectType COMMIT
      A commit, which is a submodule.
    • TAG

      public static final GitObjectType TAG
      A tag, which is a reference to a specific commit and may be annotated, signed or lightweight.
    • TREE

      public static final GitObjectType TREE
      A tree, which is a directory.
  • Method Details

    • values

      public static GitObjectType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static GitObjectType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • fromObjectType

      @Nonnull public static GitObjectType fromObjectType(String objectType)
      Determines the GitObjectType for the provided git cat-file -t object type.
      Parameters:
      objectType - the git object type
      Returns:
      the GitObjectType associated with the provided git object type
      Throws:
      IllegalArgumentException - if no GitObjectType matches the provided git object type
    • getNodeType

      @Nullable public com.atlassian.bitbucket.content.ContentTreeNode.Type getNodeType()
      Retrieves the ContentTreeNode.Type for this object type, which may be null for object types that are not readily expressed in as content nodes.
      Returns:
      the content node type for this object type, or null if this object should not be shown in the content tree
    • getObjectType

      @Nonnull public String getObjectType()
      Retrieves the type used by git cat-file -t to represent this object type.
      Returns:
      the git object type