Class ExplicitlySetBmcModel


  • public abstract class ExplicitlySetBmcModel
    extends Object
    Base class for models implementing the explicitly set behavior.

    Subclasses should be annotated with com.fasterxml.jackson.annotation.JsonFilter(com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel.EXPLICITLY_SET_FILTER_NAME).

    All the properties that were explicitly set by user will be serialized, even if set to null.

    • Field Detail

      • EXPLICITLY_SET_FILTER_NAME

        public static final String EXPLICITLY_SET_FILTER_NAME
        The name of the explicitly set filter for usage in serialization / deserialization implementations
        See Also:
        Constant Field Values
      • EXPLICITLY_SET_PROPERTY_NAME

        public static final String EXPLICITLY_SET_PROPERTY_NAME
        The name of the explicitly set map property for usage in serialization / deserialization implementations
        See Also:
        Constant Field Values
    • Constructor Detail

      • ExplicitlySetBmcModel

        public ExplicitlySetBmcModel()
    • Method Detail

      • markPropertyAsExplicitlySet

        protected void markPropertyAsExplicitlySet​(String propertyName)
        Specify that a model property was explicitly set by user.

        The method should be used inside property setters.

        Parameters:
        propertyName - the name of the model property to mark as set by user. Should match the property name exactly.
      • wasPropertyExplicitlySet

        public boolean wasPropertyExplicitlySet​(String propertyName)
        Get whether a property was explicitly specified by user.

        It is highly unlikely that this is the method you want to use as a user.

        Parameters:
        propertyName - the name of the property.
        Returns:
        whether the property was explicitly specified by user.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object