com.github.mmuller88.alpsUnifiedTs.DocDef Maven / Gradle / Ivy
package com.github.mmuller88.alpsUnifiedTs;
/**
* A text field that contains free-form, usually human-readable, text.
*
* The 'doc' element MAY have two properties: 'href' and 'format'. If
* the 'href' property appears it SHOULD contain a dereferencable URL
* that points to human-readable text. If the 'format' property appears
* it SHOULD contain one of the following values: 'text', 'html',
* 'asciidoc', or 'markdown'. Any program processing 'doc' elements
* SHOULD honor the 'format' directive and parse/render the content
* appropriately. If the value in the 'format' property is not
* recognized and/or supported, the processing program MUST treat the
* content as plain text. If no 'format' property is present, the
* content SHOULD be treated as plain text.
* JSON: { "doc" : { "format" : "text" , "value" : "Date of Birth ...""} }
*
* A 'doc' element SHOULD appear as a child of 'descriptor'. When
* present, it describes the meaning and use of the related 'descriptor'.
* JSON: { "descriptor" : [ { "doc" : { "value" : "..." } ... ] }
*
* The 'doc' element MAY appear as a child of 'alps'. When present, it
* describes the purpose of the ALPS document as a whole.
* JSON: { "alps : { "doc" : { "value" : "..." } } ... }
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.16.0 (build 99a3413)", date = "2020-12-19T21:27:37.750Z")
@software.amazon.jsii.Jsii(module = com.github.mmuller88.alpsUnifiedTs.$Module.class, fqn = "alps-unified-ts.DocDef")
@software.amazon.jsii.Jsii.Proxy(DocDef.Jsii$Proxy.class)
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public interface DocDef extends software.amazon.jsii.JsiiSerializable {
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@org.jetbrains.annotations.NotNull java.lang.String getValue();
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getFormat() {
return null;
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
default @org.jetbrains.annotations.Nullable java.lang.String getHref() {
return null;
}
/**
* @return a {@link Builder} of {@link DocDef}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link DocDef}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public static final class Builder implements software.amazon.jsii.Builder {
private java.lang.String value;
private java.lang.String format;
private java.lang.String href;
/**
* Sets the value of {@link DocDef#getValue}
* @param value the value to be set. This parameter is required.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder value(java.lang.String value) {
this.value = value;
return this;
}
/**
* Sets the value of {@link DocDef#getFormat}
* @param format the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder format(java.lang.String format) {
this.format = format;
return this;
}
/**
* Sets the value of {@link DocDef#getHref}
* @param href the value to be set.
* @return {@code this}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
public Builder href(java.lang.String href) {
this.href = href;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link DocDef}
* @throws NullPointerException if any required attribute was not provided
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@Override
public DocDef build() {
return new Jsii$Proxy(value, format, href);
}
}
/**
* An implementation for {@link DocDef}
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable)
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements DocDef {
private final java.lang.String value;
private final java.lang.String format;
private final java.lang.String href;
/**
* Constructor that initializes the object based on values retrieved from the JsiiObject.
* @param objRef Reference to the JSII managed object.
*/
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
this.value = software.amazon.jsii.Kernel.get(this, "value", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.format = software.amazon.jsii.Kernel.get(this, "format", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
this.href = software.amazon.jsii.Kernel.get(this, "href", software.amazon.jsii.NativeType.forClass(java.lang.String.class));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
protected Jsii$Proxy(final java.lang.String value, final java.lang.String format, final java.lang.String href) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.value = java.util.Objects.requireNonNull(value, "value is required");
this.format = format;
this.href = href;
}
@Override
public final java.lang.String getValue() {
return this.value;
}
@Override
public final java.lang.String getFormat() {
return this.format;
}
@Override
public final java.lang.String getHref() {
return this.href;
}
@Override
@software.amazon.jsii.Internal
public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
data.set("value", om.valueToTree(this.getValue()));
if (this.getFormat() != null) {
data.set("format", om.valueToTree(this.getFormat()));
}
if (this.getHref() != null) {
data.set("href", om.valueToTree(this.getHref()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("alps-unified-ts.DocDef"));
struct.set("data", data);
final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
obj.set("$jsii.struct", struct);
return obj;
}
@Override
public final boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DocDef.Jsii$Proxy that = (DocDef.Jsii$Proxy) o;
if (!value.equals(that.value)) return false;
if (this.format != null ? !this.format.equals(that.format) : that.format != null) return false;
return this.href != null ? this.href.equals(that.href) : that.href == null;
}
@Override
public final int hashCode() {
int result = this.value.hashCode();
result = 31 * result + (this.format != null ? this.format.hashCode() : 0);
result = 31 * result + (this.href != null ? this.href.hashCode() : 0);
return result;
}
}
}