private ImmutableConnectorSettings(ImmutableConnectorSettings.Builder builder) { this.connectorTemplateId = builder.connectorTemplateId; this.description = builder.description; this.icon = builder.icon; this.name = builder.name; this.properties = createUnmodifiableMap(false, false, builder.properties); this.configuredProperties = builder.configuredPropertiesIsSet() ? createUnmodifiableMap(false, false, builder.configuredProperties) : createUnmodifiableMap(true, false, ConnectorSettings.super.getConfiguredProperties()); }
/** * Copy the current immutable object with elements that replace the content of {@link PropertyRelation#getWhen() when}. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param elements An iterable of when elements to set * @return A modified copy of {@code this} object */ public final ImmutablePropertyRelation withWhen(Iterable<? extends PropertyRelation.When> elements) { if (this.when == elements) return this; List<PropertyRelation.When> newValue = createUnmodifiableList(false, createSafeList(elements, true, false)); return validate(new ImmutablePropertyRelation(this, this.action, newValue)); }
static Connector mockConnector(final String id) { return new Connector.Builder().id(id) .putProperty("clientId", new ConfigurationProperty.Builder().addTag(Credentials.CLIENT_ID_TAG).build()) .putProperty("clientSecret", new ConfigurationProperty.Builder().addTag(Credentials.CLIENT_SECRET_TAG).build()) .putConfiguredProperty("clientId", "a-client-id") .putConfiguredProperty("clientSecret", "a-client-secret").build(); } }
/** * Copy the current immutable object by setting a value for the {@link DynamicActionMetadata#inputShape() inputShape} attribute. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for inputShape (can be {@code null}) * @return A modified copy of the {@code this} object */ public final ImmutableDynamicActionMetadata withInputShape(DataShape value) { if (this.inputShape == value) return this; return validate(new ImmutableDynamicActionMetadata(this, this.properties, value, this.outputShape)); }
/** * Construct a new immutable {@code PropertyValue} instance. * @param label The value for the {@code label} attribute * @param value The value for the {@code value} attribute * @return An immutable PropertyValue instance */ public static ConfigurationProperty.PropertyValue of(String label, String value) { return validate(new ImmutablePropertyValue(label, value)); }
private ImmutablePropertyRelation( String action, Iterable<? extends PropertyRelation.When> when) { this.action = action; this.when = createUnmodifiableList(false, createSafeList(when, true, false)); }
/** * Construct a new immutable {@code ConnectorGroup} instance. * @param id The value for the {@code id} attribute * @param name The value for the {@code name} attribute * @return An immutable ConnectorGroup instance */ public static ConnectorGroup of(Optional<String> id, String name) { return validate(new ImmutableConnectorGroup(id, name)); }
/** * Construct a new immutable {@code ActionPropertySuggestion} instance. * @param displayValue The value for the {@code displayValue} attribute * @param value The value for the {@code value} attribute * @return An immutable ActionPropertySuggestion instance */ public static DynamicActionMetadata.ActionPropertySuggestion of(String displayValue, String value) { return validate(new ImmutableActionPropertySuggestion(displayValue, value)); }
/** * Builds a new {@link ConnectorGroup ConnectorGroup}. * @return An immutable instance of ConnectorGroup * @throws java.lang.IllegalStateException if any required attributes are missing */ public ConnectorGroup build() { return ImmutableConnectorGroup.validate(new ImmutableConnectorGroup(null, id, name)); } }
/** * Builds a new {@link Connection Connection}. * @return An immutable instance of Connection * @throws java.lang.IllegalStateException if any required attributes are missing */ public Connection build() { return ImmutableConnection.validate(new ImmutableConnection(this)); }
/** * Builds a new {@link ConnectorTemplate ConnectorTemplate}. * @return An immutable instance of ConnectorTemplate * @throws java.lang.IllegalStateException if any required attributes are missing */ public ConnectorTemplate build() { return ImmutableConnectorTemplate.validate(new ImmutableConnectorTemplate(this)); }
/** * Builds a new {@link DynamicActionMetadata.ActionPropertySuggestion ActionPropertySuggestion}. * @return An immutable instance of ActionPropertySuggestion * @throws java.lang.IllegalStateException if any required attributes are missing */ public DynamicActionMetadata.ActionPropertySuggestion build() { return ImmutableActionPropertySuggestion.validate(new ImmutableActionPropertySuggestion(displayValue, value)); } }
private ImmutableDynamicActionMetadata( Map<String, ? extends List<DynamicActionMetadata.ActionPropertySuggestion>> properties, DataShape inputShape, DataShape outputShape) { this.properties = createUnmodifiableMap(true, false, properties); this.inputShape = inputShape; this.outputShape = outputShape; }
/** * Builds a new {@link Connector Connector}. * @return An immutable instance of Connector * @throws java.lang.IllegalStateException if any required attributes are missing */ public Connector build() { return ImmutableConnector.validate(new ImmutableConnector(this)); }
/** * Construct a new immutable {@code PropertyRelation} instance. * @param action The value for the {@code action} attribute * @param when The value for the {@code when} attribute * @return An immutable PropertyRelation instance */ public static PropertyRelation of(String action, List<PropertyRelation.When> when) { return of(action, (Iterable<? extends PropertyRelation.When>) when); }
/** * Builds a new {@link PropertyRelation.When When}. * @return An immutable instance of When * @throws java.lang.IllegalStateException if any required attributes are missing */ public PropertyRelation.When build() { return ImmutableWhen.validate(new ImmutableWhen(id, value)); } }
/** * Copy the current immutable object by setting a value for the {@link DynamicActionMetadata#outputShape() outputShape} attribute. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for outputShape (can be {@code null}) * @return A modified copy of the {@code this} object */ public final ImmutableDynamicActionMetadata withOutputShape(DataShape value) { if (this.outputShape == value) return this; return validate(new ImmutableDynamicActionMetadata(this, this.properties, this.inputShape, value)); }
/** * Construct a new immutable {@code DynamicActionMetadata} instance. * @param properties The value for the {@code properties} attribute * @param inputShape The value for the {@code inputShape} attribute * @param outputShape The value for the {@code outputShape} attribute * @return An immutable DynamicActionMetadata instance */ public static DynamicActionMetadata of(Map<String, ? extends List<DynamicActionMetadata.ActionPropertySuggestion>> properties, DataShape inputShape, DataShape outputShape) { return validate(new ImmutableDynamicActionMetadata(properties, inputShape, outputShape)); }