Class Tag

java.lang.Object
org.yaml.snakeyaml.nodes.Tag

public final class Tag
extends java.lang.Object
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static Tag BINARY  
    static Tag BOOL  
    protected static java.util.Map<Tag,​java.util.Set<java.lang.Class<?>>> COMPATIBILITY_MAP  
    static Tag FLOAT  
    static Tag INT  
    static Tag MAP  
    static Tag MERGE  
    static Tag NULL  
    static Tag OMAP  
    static Tag PAIRS  
    static java.lang.String PREFIX  
    static Tag SEQ  
    static Tag SET  
    static Tag STR  
    static Tag TIMESTAMP  
    static Tag YAML  
  • Constructor Summary

    Constructors 
    Constructor Description
    Tag​(java.lang.Class<? extends java.lang.Object> clazz)  
    Tag​(java.lang.String tag)  
    Tag​(java.net.URI uri)
    Deprecated.
    - it will be removed
  • Method Summary

    Modifier and Type Method Description
    boolean equals​(java.lang.Object obj)  
    java.lang.String getClassName()  
    java.lang.String getValue()  
    int hashCode()  
    boolean isCompatible​(java.lang.Class<?> clazz)
    Java has more then 1 class compatible with a language-independent tag (!!int, !!float, !!timestamp etc)
    boolean isSecondary()  
    boolean matches​(java.lang.Class<? extends java.lang.Object> clazz)
    Check whether this tag matches the global tag for the Class
    boolean startsWith​(java.lang.String prefix)  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • Tag

      public Tag​(java.lang.String tag)
    • Tag

      public Tag​(java.lang.Class<? extends java.lang.Object> clazz)
    • Tag

      public Tag​(java.net.URI uri)
      Deprecated.
      - it will be removed
      Parameters:
      uri - - URI to be encoded as tag value
  • Method Details

    • isSecondary

      public boolean isSecondary()
    • getValue

      public java.lang.String getValue()
    • startsWith

      public boolean startsWith​(java.lang.String prefix)
    • getClassName

      public java.lang.String getClassName()
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • equals

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

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

      public boolean isCompatible​(java.lang.Class<?> clazz)
      Java has more then 1 class compatible with a language-independent tag (!!int, !!float, !!timestamp etc)
      Parameters:
      clazz - - Class to check compatibility
      Returns:
      true when the Class can be represented by this language-independent tag
    • matches

      public boolean matches​(java.lang.Class<? extends java.lang.Object> clazz)
      Check whether this tag matches the global tag for the Class
      Parameters:
      clazz - - Class to check
      Returns:
      true when the this tag can be used as a global tag for the Class