Module jamal.tools

Class NamedMarker

  • All Implemented Interfaces:
    Marker

    public class NamedMarker
    extends java.lang.Object
    implements Marker
    Implementation of the Marker interface that requires that the name passed as argument is the same in the objects passed to pop(Marker) and to push(Marker). The objects do not need to be the same, only the string passed in name to the constructor has to be the same.
    • Constructor Summary

      Constructors 
      Constructor Description
      NamedMarker​(java.lang.String name, java.util.function.Function<java.lang.String,​java.lang.String> decorator)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • NamedMarker

        public NamedMarker​(java.lang.String name,
                           java.util.function.Function<java.lang.String,​java.lang.String> decorator)
        Parameters:
        name - is the identifier of the marker used to check the equality
        decorator - a decorator used to create the string representation of the marker. This string representation is used in the error messages in the exceptions that are thrown.
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • 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