@Beta public class ScpCfServiceInfo extends Object
Be aware that this class is in Beta (as indicated by the annotation) and therefore subject to breaking changes.
Constructor and Description |
---|
ScpCfServiceInfo(com.google.gson.JsonElement serviceInfoElem,
String serviceType)
Also parses the name from serviceInfoElem.
|
Modifier and Type | Method and Description |
---|---|
static List<ScpCfServiceInfo> |
createFor(ScpCfServiceDesignator designator)
Creates the list of services from the VCAP_SERVICES environment variable.
|
static List<ScpCfServiceInfo> |
createFor(String serviceType)
Creates the list of services from the VCAP_SERVICES environment variable.
|
static List<ScpCfServiceInfo> |
createFor(String serviceType,
String servicePlan)
Creates the list of services from the VCAP_SERVICES environment variable.
|
com.google.gson.JsonElement |
getServiceInfoElem() |
static com.google.gson.JsonElement |
getServiceInfoPath(com.google.gson.JsonElement subElem,
Iterator<String> pathElems)
Descend nicely.
|
static com.google.gson.JsonElement |
getServiceInfoPath(com.google.gson.JsonElement subElem,
String path)
Descend nicely.
|
com.google.gson.JsonElement |
getServiceInfoPath(String path)
Descend nicely into the service info element.
|
String |
getServiceInfoPathNonEmptyStringOrThrow(String path,
String humanReadableElemReference)
Descend nicely into the service info and throw if anything but a non-empty string at the final destination of the
path.
|
String |
getServiceName() |
String |
getServicePlan() |
String |
getServiceType() |
String |
toString() |
@Nonnull public static List<ScpCfServiceInfo> createFor(@Nonnull String serviceType)
serviceType
- to get the services forCloudPlatformException
- if not executed on the Cloud Foundry type SAP Cloud Platform@Nonnull public static List<ScpCfServiceInfo> createFor(@Nonnull String serviceType, @Nullable String servicePlan)
serviceType
- to get the services forservicePlan
- to optionally filter by. if specified, only service bindings are returned that exactly match this planCloudPlatformException
- if not executed on the Cloud Foundry type SAP Cloud Platform@Nonnull public static List<ScpCfServiceInfo> createFor(@Nonnull ScpCfServiceDesignator designator)
designator
- to get the services forCloudPlatformException
- if not executed on the Cloud Foundry type SAP Cloud Platform@Nonnull public String getServiceInfoPathNonEmptyStringOrThrow(@Nonnull String path, @Nonnull String humanReadableElemReference)
path
- the path, split at /humanReadableElemReference
- to use in the exception's message as the name of the element.ServiceBindingDataException
- if anything happens instead of finding a non-empty string at the leaf.getServiceInfoElem()
@Nullable public com.google.gson.JsonElement getServiceInfoPath(@Nonnull String path)
path
- the path, split at /NoSuchElementException
- if the path cannot be followed because a path element is missing.getServiceInfoElem()
@Nullable public static com.google.gson.JsonElement getServiceInfoPath(@Nullable com.google.gson.JsonElement subElem, @Nonnull String path)
subElem
- to descend intopath
- the path, split at /NoSuchElementException
- if the path cannot be followed because a path element is missing.@Nullable public static com.google.gson.JsonElement getServiceInfoPath(@Nullable com.google.gson.JsonElement subElem, @Nonnull Iterator<String> pathElems)
subElem
- to descend intopathElems
- the pathNoSuchElementException
- if the path cannot be followed because a path element is missing.IllegalArgumentException
- if the iterator is returning null or subElem is not a JSON object.public com.google.gson.JsonElement getServiceInfoElem()
public String getServiceType()
public String getServiceName()
Copyright © 2021 SAP SE. All rights reserved.