Class DataAttributesAccessor

  • All Implemented Interfaces:
    DataAttributesBase

    public final class DataAttributesAccessor
    extends NativeBase
    implements DataAttributesBase

    Accessor used for manipulating data attributes.

    Note: This is a beta release of this feature, so there could be a few bugs and unexpected behavior. Related APIs may change for new releases without a deprecation process.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addOrReplace​(java.lang.String name, boolean value)
      Adds or replaces a boolean attribute.
      void addOrReplace​(java.lang.String name, double value)
      Adds or replaces a double precision floating decimal attribute.
      void addOrReplace​(java.lang.String name, float value)
      Adds or replaces a single precision floating decimal attribute.
      void addOrReplace​(java.lang.String name, long value)
      Adds or replaces a 64-bits integer attribute.
      void addOrReplace​(java.lang.String name, DataAttributeValue value)
      Adds or replaces an attribute.
      void addOrReplace​(java.lang.String name, java.lang.String value)
      Adds or replaces a string attribute.
      java.lang.String getAsString​(java.lang.String name)
      Gets the value of an attribute as a string or null if it is not contained.
      java.util.List<java.lang.String> getAttributeNames()
      Returns a list of attribute names.
      java.lang.Boolean getBoolean​(java.lang.String name)
      Gets the value of a boolean attribute or null if it is not contained or the type doesn't match.
      java.lang.Double getDouble​(java.lang.String name)
      Gets the value of a double precision floating decimal attribute or null if it is not contained or the type doesn't match.
      java.lang.Float getFloat​(java.lang.String name)
      Gets the value of a single precision floating decimal attribute or null if it is not contained or the type doesn't match.
      java.lang.Long getInt64​(java.lang.String name)
      Gets the value of a 64-bits integer attribute or null if it is not contained or the type doesn't match.
      java.lang.String getString​(java.lang.String name)
      Gets the value of a string attribute or null if it is not contained or the type doesn't match.
      DataAttributeValue getValue​(java.lang.String name)
      Gets the DataAttributeValue or null if it is not contained.
      DataAttributeValue.ValueType getValueType​(java.lang.String name)
      Returns the value type of an attribute or null if it is not contained.
      void remove​(java.lang.String name)
      Removes an attribute by name.
      void removeAll()
      Removes all attributes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • addOrReplace

        public void addOrReplace​(@NonNull
                                 java.lang.String name,
                                 @NonNull
                                 java.lang.String value)

        Adds or replaces a string attribute.

        Parameters:
        name -

        Attribute name.

        value -

        Attribute value.

      • addOrReplace

        public void addOrReplace​(@NonNull
                                 java.lang.String name,
                                 long value)

        Adds or replaces a 64-bits integer attribute.

        Parameters:
        name -

        Attribute name.

        value -

        Attribute value.

      • addOrReplace

        public void addOrReplace​(@NonNull
                                 java.lang.String name,
                                 float value)

        Adds or replaces a single precision floating decimal attribute.

        Parameters:
        name -

        Attribute name.

        value -

        Attribute value.

      • addOrReplace

        public void addOrReplace​(@NonNull
                                 java.lang.String name,
                                 double value)

        Adds or replaces a double precision floating decimal attribute.

        Parameters:
        name -

        Attribute name.

        value -

        Attribute value.

      • addOrReplace

        public void addOrReplace​(@NonNull
                                 java.lang.String name,
                                 boolean value)

        Adds or replaces a boolean attribute.

        Parameters:
        name -

        Attribute name.

        value -

        Attribute value.

      • addOrReplace

        public void addOrReplace​(@NonNull
                                 java.lang.String name,
                                 @NonNull
                                 DataAttributeValue value)

        Adds or replaces an attribute.

        Parameters:
        name -

        Attribute name.

        value -

        Attribute value.

      • remove

        public void remove​(@NonNull
                           java.lang.String name)

        Removes an attribute by name.

        Parameters:
        name -

        Attribute name.

      • removeAll

        public void removeAll()

        Removes all attributes.

      • getAttributeNames

        @NonNull
        public java.util.List<java.lang.String> getAttributeNames()

        Returns a list of attribute names.

        Specified by:
        getAttributeNames in interface DataAttributesBase
        Returns:

        The list of attribute names.

      • getValueType

        @Nullable
        public DataAttributeValue.ValueType getValueType​(@NonNull
                                                         java.lang.String name)

        Returns the value type of an attribute or null if it is not contained.

        Specified by:
        getValueType in interface DataAttributesBase
        Parameters:
        name -

        Attribute name.

        Returns:

        Attribute value type or null if it is not contained.

      • getAsString

        @Nullable
        public java.lang.String getAsString​(@NonNull
                                            java.lang.String name)

        Gets the value of an attribute as a string or null if it is not contained.

        Specified by:
        getAsString in interface DataAttributesBase
        Parameters:
        name -

        Attribute name.

        Returns:

        Attribute value.

      • getString

        @Nullable
        public java.lang.String getString​(@NonNull
                                          java.lang.String name)

        Gets the value of a string attribute or null if it is not contained or the type doesn't match.

        Specified by:
        getString in interface DataAttributesBase
        Parameters:
        name -

        Attribute name.

        Returns:

        Attribute value.

      • getInt64

        @Nullable
        public java.lang.Long getInt64​(@NonNull
                                       java.lang.String name)

        Gets the value of a 64-bits integer attribute or null if it is not contained or the type doesn't match.

        Specified by:
        getInt64 in interface DataAttributesBase
        Parameters:
        name -

        Attribute name.

        Returns:

        Attribute value.

      • getFloat

        @Nullable
        public java.lang.Float getFloat​(@NonNull
                                        java.lang.String name)

        Gets the value of a single precision floating decimal attribute or null if it is not contained or the type doesn't match.

        Specified by:
        getFloat in interface DataAttributesBase
        Parameters:
        name -

        Attribute name.

        Returns:

        Attribute value.

      • getDouble

        @Nullable
        public java.lang.Double getDouble​(@NonNull
                                          java.lang.String name)

        Gets the value of a double precision floating decimal attribute or null if it is not contained or the type doesn't match.

        Specified by:
        getDouble in interface DataAttributesBase
        Parameters:
        name -

        Attribute name.

        Returns:

        Attribute value.

      • getBoolean

        @Nullable
        public java.lang.Boolean getBoolean​(@NonNull
                                            java.lang.String name)

        Gets the value of a boolean attribute or null if it is not contained or the type doesn't match.

        Specified by:
        getBoolean in interface DataAttributesBase
        Parameters:
        name -

        Attribute name.

        Returns:

        Attribute value.

      • getValue

        @Nullable
        public DataAttributeValue getValue​(@NonNull
                                           java.lang.String name)

        Gets the DataAttributeValue or null if it is not contained.

        Specified by:
        getValue in interface DataAttributesBase
        Parameters:
        name -

        Attribute name.

        Returns:

        Attribute value.