Class Replacement


  • public final class Replacement
    extends java.lang.Object
    Represents a range in the original source and replacement text for that range.

    google-java-format doesn't depend on AutoValue, to allow AutoValue to depend on google-java-format.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String replacementString  
      private com.google.common.collect.Range<java.lang.Integer> replaceRange  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Replacement​(com.google.common.collect.Range<java.lang.Integer> replaceRange, java.lang.String replacementString)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static Replacement create​(int startPosition, int endPosition, java.lang.String replaceWith)  
      boolean equals​(java.lang.Object o)  
      java.lang.String getReplacementString()
      The string to replace the range of characters with.
      com.google.common.collect.Range<java.lang.Integer> getReplaceRange()
      The range of characters in the original source to replace.
      int hashCode()  
      • Methods inherited from class java.lang.Object

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

      • replaceRange

        private final com.google.common.collect.Range<java.lang.Integer> replaceRange
      • replacementString

        private final java.lang.String replacementString
    • Constructor Detail

      • Replacement

        private Replacement​(com.google.common.collect.Range<java.lang.Integer> replaceRange,
                            java.lang.String replacementString)
    • Method Detail

      • create

        public static Replacement create​(int startPosition,
                                         int endPosition,
                                         java.lang.String replaceWith)
      • getReplaceRange

        public com.google.common.collect.Range<java.lang.Integer> getReplaceRange()
        The range of characters in the original source to replace.
      • getReplacementString

        public java.lang.String getReplacementString()
        The string to replace the range of characters with.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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