private ImmutableConnectorSettings( String connectorTemplateId, String description, String icon, String name, Map<String, ? extends ConfigurationProperty> properties, Map<String, ? extends String> configuredProperties) { this.connectorTemplateId = connectorTemplateId; this.description = description; this.icon = icon; this.name = name; this.properties = createUnmodifiableMap(true, false, properties); this.configuredProperties = createUnmodifiableMap(true, false, configuredProperties); }
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 by replacing the {@link ConnectorSettings#getProperties() properties} map with the specified map. * Nulls are not permitted as keys or values. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param entries The entries to be added to the properties map * @return A modified copy of {@code this} object */ public final ImmutableConnectorSettings withProperties(Map<String, ? extends ConfigurationProperty> entries) { if (this.properties == entries) return this; Map<String, ConfigurationProperty> newValue = createUnmodifiableMap(true, false, entries); return validate(new ImmutableConnectorSettings( this, this.connectorTemplateId, this.description, this.icon, this.name, newValue, this.configuredProperties)); }
/** * Copy the current immutable object by replacing the {@link ConnectorSettings#getConfiguredProperties() configuredProperties} map with the specified map. * Nulls are not permitted as keys or values. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param entries The entries to be added to the configuredProperties map * @return A modified copy of {@code this} object */ public final ImmutableConnectorSettings withConfiguredProperties(Map<String, ? extends String> entries) { if (this.configuredProperties == entries) return this; Map<String, String> newValue = createUnmodifiableMap(true, false, entries); return validate(new ImmutableConnectorSettings( this, this.connectorTemplateId, this.description, this.icon, this.name, this.properties, newValue)); }