Class AheadBehind


  • public class AheadBehind
    extends java.lang.Object
    A local git repository can either be "ahead", or "behind" in the number of commits relative to the remote repository. This class tracks the amount of commits the local git repository is "behind", or "ahead" relative to it's remote. :warning: You must set the offline-setting of the plugin to false when you want to ensure that the properties generated are truly up-to-date. Otherwise the local state of the git repository is used which might be out-of-date.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static AheadBehind NO_REMOTE
      Indication that we could not find a remote repository to calculate a "behind", or "ahead" relation.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String ahead()  
      java.lang.String behind()  
      boolean equals​(java.lang.Object obj)  
      int hashCode()  
      static AheadBehind of​(int ahead, int behind)
      Constructor for a "AheadBehind"-object.
      static AheadBehind of​(java.lang.String ahead, java.lang.String behind)
      Constructor for a "AheadBehind"-object.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • NO_REMOTE

        public static final AheadBehind NO_REMOTE
        Indication that we could not find a remote repository to calculate a "behind", or "ahead" relation.
    • Method Detail

      • of

        public static AheadBehind of​(int ahead,
                                     int behind)
        Constructor for a "AheadBehind"-object.
        Parameters:
        ahead - Number of commits the local repository is "ahead" in relation to it's remote.
        behind - Number of commits the local repository is "behind" in relation to it's remote.
        Returns:
        a "AheadBehind"-object.
      • of

        public static AheadBehind of​(java.lang.String ahead,
                                     java.lang.String behind)
        Constructor for a "AheadBehind"-object.
        Parameters:
        ahead - Number of commits the local repository is "ahead" in relation to it's remote.
        behind - Number of commits the local repository is "behind" in relation to it's remote.
        Returns:
        a "AheadBehind"-object.
      • ahead

        public java.lang.String ahead()
        Returns:
        Number of commits the local repository is "ahead" in relation to it's remote.
      • behind

        public java.lang.String behind()
        Returns:
        Number of commits the local repository is "behind" in relation to it's remote.
      • hashCode

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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object