java.lang.Object
org.springframework.cloud.servicebroker.model.Context
Direct Known Subclasses:
CloudFoundryContext, KubernetesContext, PlatformContext

public class Context extends Object
Platform specific contextual information under which the service instance is to be provisioned or updated. Fields known by concrete subtypes will be parsed into discrete properties of the appropriate subtype. Any additional properties will available using getProperty(String).
Author:
Scott Frederick, Roy Clarkson
  • Field Details

  • Constructor Details

    • Context

      protected Context()
      Create a new Context.
    • Context

      protected Context(String platform, Map<String,Object> properties)
      Create a new Context.
      Parameters:
      platform - the name of the platform
      properties - collection of properties
  • Method Details

    • getPlatform

      public String getPlatform()
      Get the name of the platform making the request.
      Returns:
      the platform identifier
    • getProperties

      public Map<String,Object> getProperties()
      Get all properties in the context.
      Returns:
      the collection of properties
    • setProperties

      public void setProperties(String key, Object value)
      Set a property in the context.
      Parameters:
      key - the key of the property
      value - the value of the property
    • getProperty

      public Object getProperty(String key)
      Get the value of a property in the context with the given key.
      Parameters:
      key - the key of the property to retrieve
      Returns:
      the value of the property, or null if the key is not present in the request
    • getStringProperty

      protected String getStringProperty(String key)
      Get the String value of a property in the context with the given key.
      Parameters:
      key - the key of the property to retrieve
      Returns:
      the value of the property, or null if the key is not present in the request
    • setStringProperty

      protected void setStringProperty(String key, String value)
      Set the String value of a property in the context with the given key. Null keys and values are ignored.
      Parameters:
      key - the key of the property
      value - the value of the property
    • getMapProperty

      protected Map<String,Object> getMapProperty(String key)
      Get the Map value of a property in the context with the given key.
      Parameters:
      key - the key of the property to retrieve
      Returns:
      the value of the property, or null if the key is not present in the request
    • setMapProperty

      protected void setMapProperty(String key, Map<String,Object> map)
      Set the Map value of a property in the context with the given key. Null keys and empty maps are ignored.
      Parameters:
      key - the key of the property
      map - the map to set as the value of the property
    • equals

      public final boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      public final boolean canEqual(Object other)
      Is another object type compatible with this object.
      Parameters:
      other - the other object
      Returns:
      true of compatible
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public final String toString()
      Overrides:
      toString in class Object