Class Context
java.lang.Object
org.springframework.cloud.servicebroker.model.Context
- Direct Known Subclasses:
CloudFoundryContext
,KubernetesContext
,PlatformContext
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
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Context.ContextBaseBuilder<R extends Context,
B extends Context.ContextBaseBuilder<R, B>> Builder class for Context. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Is another object type compatible with this object.final boolean
getMapProperty
(String key) Get the Map value of a property in the context with the given key.Get the name of the platform making the request.Get all properties in the context.getProperty
(String key) Get the value of a property in the context with the given key.protected String
getStringProperty
(String key) Get the String value of a property in the context with the given key.final int
hashCode()
protected void
setMapProperty
(String key, Map<String, Object> map) Set the Map value of a property in the context with the given key.void
setProperties
(String key, Object value) Set a property in the context.protected void
setStringProperty
(String key, String value) Set the String value of a property in the context with the given key.final String
toString()
-
Field Details
-
PLATFORM_KEY
Platform key.- See Also:
-
platform
-
properties
-
-
Constructor Details
-
Context
protected Context()Create a new Context. -
Context
Create a new Context.- Parameters:
platform
- the name of the platformproperties
- collection of properties
-
-
Method Details
-
getPlatform
Get the name of the platform making the request.- Returns:
- the platform identifier
-
getProperties
Get all properties in the context.- Returns:
- the collection of properties
-
setProperties
Set a property in the context.- Parameters:
key
- the key of the propertyvalue
- the value of the property
-
getProperty
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
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
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 propertyvalue
- the value of the property
-
getMapProperty
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
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 propertymap
- the map to set as the value of the property
-
equals
-
canEqual
Is another object type compatible with this object.- Parameters:
other
- the other object- Returns:
- true of compatible
-
hashCode
public final int hashCode() -
toString
-