Class WrongObjectTypeException

  • All Implemented Interfaces:
    java.io.Serializable

    public class WrongObjectTypeException
    extends GitAPIException
    A given object is not of an expected object type.
    Since:
    5.11
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String name  
      private static long serialVersionUID  
      private int type  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getExpectedType()
      Retrieves the expected type code.
      java.lang.String getObjectId()
      Retrieves the name (SHA-1) of the object.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • name

        private java.lang.String name
      • type

        private int type
    • Constructor Detail

      • WrongObjectTypeException

        public WrongObjectTypeException​(ObjectId id,
                                        int type)
        Construct a WrongObjectTypeException for the specified object id, giving the expected type.
        Parameters:
        id - ObjectId of the object with the unexpected type
        type - expected object type code; see Constants.OBJ_*.
    • Method Detail

      • getObjectId

        public java.lang.String getObjectId()
        Retrieves the name (SHA-1) of the object.
        Returns:
        the name
      • getExpectedType

        public int getExpectedType()
        Retrieves the expected type code. See Constants.OBJ_*.
        Returns:
        the type code