Interface NodeAttribute

  • All Known Implementing Classes:
    SimpleNodeAttribute

    public interface NodeAttribute
    Interface that abstracts the idea of an attribute. An attribute has a name, a value, boolean indicating if its an optional attribute and a default value
    Author:
    Abhishek Sanoujam
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      NodeAttribute defaultValue​(java.lang.String defaultValue)
      Builder convenience method for setting defaultValue
      java.lang.String getDefaultValue()
      Returns the default value of the attribute
      java.lang.String getName()
      Name of the attribute
      java.lang.String getValue()
      Value of the attribute
      boolean isOptional()
      Returns true if the attribute is optional, otherwise false
      NodeAttribute optional​(boolean optional)
      Builder convenience method for setting optional
      void setDefaultValue​(java.lang.String defaultValue)
      Default value setter
      void setOptional​(boolean optional)
      Sets this attribute to optional or not
      void setValue​(java.lang.String value)
      Setter for value
    • Method Detail

      • getName

        java.lang.String getName()
        Name of the attribute
        Returns:
        Name of the attribute
      • getValue

        java.lang.String getValue()
        Value of the attribute
        Returns:
        value of the attribute
      • isOptional

        boolean isOptional()
        Returns true if the attribute is optional, otherwise false
        Returns:
        Returns true if the attribute is optional, otherwise false
      • getDefaultValue

        java.lang.String getDefaultValue()
        Returns the default value of the attribute
        Returns:
        default value of the attribute
      • setOptional

        void setOptional​(boolean optional)
        Sets this attribute to optional or not
        Parameters:
        optional - true if this attribute is optional
      • setDefaultValue

        void setDefaultValue​(java.lang.String defaultValue)
        Default value setter
        Parameters:
        defaultValue - the default value
      • setValue

        void setValue​(java.lang.String value)
        Setter for value
        Parameters:
        value - the new value
      • optional

        NodeAttribute optional​(boolean optional)
        Builder convenience method for setting optional
        Parameters:
        optional - true if optional
        Returns:
        the same attribute instance
      • defaultValue

        NodeAttribute defaultValue​(java.lang.String defaultValue)
        Builder convenience method for setting defaultValue
        Parameters:
        defaultValue - the default value
        Returns:
        the same attribute instance