software.amazon.awscdk.ContextProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cdk Show documentation
Show all versions of cdk Show documentation
AWS Cloud Development Kit Core Library
package software.amazon.awscdk;
/**
* Base class for the model side of context providers.
*
* Instances of this class communicate with context provider plugins in the 'cdk
* toolkit' via context variables (input), outputting specialized queries for
* more context variables (output).
*
* ContextProvider needs access to a Construct to hook into the context mechanism.
*/
@javax.annotation.Generated(value = "jsii-pacmak/0.10.5 (build 46bc9b0)", date = "2019-05-06T20:49:40.944Z")
@software.amazon.jsii.Jsii(module = software.amazon.awscdk.$Module.class, fqn = "@aws-cdk/cdk.ContextProvider")
public class ContextProvider extends software.amazon.jsii.JsiiObject {
protected ContextProvider(final software.amazon.jsii.JsiiObject.InitializationMode mode) {
super(mode);
}
public ContextProvider(final software.amazon.awscdk.Construct context, final java.lang.String provider, @javax.annotation.Nullable final java.util.Map props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.Jsii);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(context, "context is required"), java.util.Objects.requireNonNull(provider, "provider is required"), props });
}
public ContextProvider(final software.amazon.awscdk.Construct context, final java.lang.String provider) {
super(software.amazon.jsii.JsiiObject.InitializationMode.Jsii);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(context, "context is required"), java.util.Objects.requireNonNull(provider, "provider is required") });
}
/**
* Read a provider value, verifying it's a list.
*
* @param defaultValue The value to return if there is no value defined for this context key.
*/
public java.util.List getStringListValue(final java.util.List defaultValue) {
return this.jsiiCall("getStringListValue", java.util.List.class, new Object[] { java.util.Objects.requireNonNull(defaultValue, "defaultValue is required") });
}
/**
* Read a provider value, verifying it's a string.
*
* @param defaultValue The value to return if there is no value defined for this context key.
*/
public java.lang.String getStringValue(final java.lang.String defaultValue) {
return this.jsiiCall("getStringValue", java.lang.String.class, new Object[] { java.util.Objects.requireNonNull(defaultValue, "defaultValue is required") });
}
/**
* Read a provider value and verify it is not `null`.
*/
@javax.annotation.Nullable
public java.lang.Object getValue(@javax.annotation.Nullable final java.lang.Object defaultValue) {
return this.jsiiCall("getValue", java.lang.Object.class, new Object[] { defaultValue });
}
public software.amazon.awscdk.Construct getContext() {
return this.jsiiGet("context", software.amazon.awscdk.Construct.class);
}
public java.lang.String getKey() {
return this.jsiiGet("key", java.lang.String.class);
}
public java.lang.String getProvider() {
return this.jsiiGet("provider", java.lang.String.class);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy