@Override public synchronized Object getOrDefault(Object key, Object defaultValue) { if (interned != null) return interned.getOrDefault(key, defaultValue); else return super.getOrDefault(key, defaultValue); }
public String getPulsarImage() { return (String) properties.getOrDefault("pulsar.container.image", "apachepulsar/pulsar"); }
public String getSocatContainerImage() { return (String) properties.getOrDefault("socat.container.image", "alpine/socat:latest"); }
public String getSSHdImage() { return (String) properties.getOrDefault("sshd.container.image", "quay.io/testcontainers/sshd@sha256:18aa929c653284189fc9cefa45b731021857b6047a0a1757e909f958f258f088"); }
public String getKafkaImage() { return (String) properties.getOrDefault("kafka.container.image", "confluentinc/cp-kafka"); }
/** * {@inheritDoc} */ @Override public Object get(String key, Object defaultValue) { return properties.getOrDefault(key, defaultValue); } }
public String getAmbassadorContainerImage() { return (String) properties.getOrDefault("ambassador.container.image", "richnorth/ambassador:latest"); }
public String getTinyImage() { return (String) properties.getOrDefault("tinyimage.container.image", "alpine:3.5"); }
public String getDockerComposeContainerImage() { return (String) properties.getOrDefault("compose.container.image", "docker/compose:1.8.0"); }
public String getRyukImage() { return (String) properties.getOrDefault("ryuk.container.image", "quay.io/testcontainers/ryuk:0.2.2"); }
public String getVncRecordedContainerImage() { return (String) properties.getOrDefault("vncrecorder.container.image", "quay.io/testcontainers/vnc-recorder:1.1.0"); }
public PluginProperties(Properties properties) { this.isolated = Boolean.parseBoolean((String) properties.getOrDefault(PROPERTY_ISOLATED, PROPERTY_ISOLATED_DEFAULT)); }
public Integer getRyukTimeout() { return Integer.parseInt((String) properties.getOrDefault("ryuk.container.timeout", "30")); }
public boolean isRyukPrivileged() { return Boolean.parseBoolean((String) properties.getOrDefault("ryuk.container.privileged", "false")); }
public boolean isDisableChecks() { return Boolean.parseBoolean((String) properties.getOrDefault("checks.disable", "false")); }
props.getOrDefault("maximumPoolSize", defaultPoolSize.toString()).toString());
/** * Get a copy of the complete configuration that is or will be used by the running server. * * @return the properties for the currently-running server; may be empty if not running */ public Properties config() { Properties runningConfig = new Properties(); runningConfig.putAll(config); runningConfig.setProperty(KafkaConfig.ZkConnectProp(), zookeeperConnection()); runningConfig.setProperty(KafkaConfig.BrokerIdProp(), Integer.toString(brokerId)); runningConfig.setProperty(KafkaConfig.HostNameProp(), "localhost"); runningConfig.setProperty(KafkaConfig.AutoCreateTopicsEnableProp(), String.valueOf(config.getOrDefault(KafkaConfig.AutoCreateTopicsEnableProp(), Boolean.TRUE))); // 1 partition for the __consumer_offsets_ topic should be enough runningConfig.setProperty(KafkaConfig.OffsetsTopicPartitionsProp(), Integer.toString(1)); // Disable delay during every re-balance runningConfig.setProperty(KafkaConfig.GroupInitialRebalanceDelayMsProp(), Integer.toString(0)); return runningConfig; }
/** * Returns the configuration value, cast to the expected type, from a map of configuration values. * If the value is not specified, the default value is returned. * * @param properties Configuration properties. * @param defaultValue The default value to return, if one is not defined. * @param clazz The class of the expected type of the configuration value. * @param <T> The expected type of the configuration value. * @return The configuration value or the specified default, if one is not defined. */ private <T> T getOrDefault(Properties properties, Object defaultValue, Class<T> clazz) { Object value = properties.getOrDefault(key, defaultValue); return value == null ? null : ConversionUtils.convert(value, clazz); }
/** * Initializes the artifact by taking into account deployment properties * {@link org.mule.runtime.core.api.config.MuleDeploymentProperties#MULE_LAZY_INIT_DEPLOYMENT_PROPERTY} * and {@link org.mule.runtime.core.api.config.MuleDeploymentProperties#MULE_LAZY_INIT_ENABLE_XML_VALIDATIONS_DEPLOYMENT_PROPERTY}. * * @param artifact the T artifact to be initialized */ private void doInit(T artifact) { boolean lazyInit = false; boolean enableXmlValidations = false; if (artifact.getDescriptor().getDeploymentProperties().isPresent()) { Properties deploymentProperties = artifact.getDescriptor().getDeploymentProperties().get(); lazyInit = valueOf((String) deploymentProperties.getOrDefault(MULE_LAZY_INIT_DEPLOYMENT_PROPERTY, "false")); enableXmlValidations = valueOf((String) deploymentProperties.getOrDefault( MULE_LAZY_INIT_ENABLE_XML_VALIDATIONS_DEPLOYMENT_PROPERTY, "false")); } if (lazyInit) { artifact.lazyInit(!enableXmlValidations); } else { artifact.init(); } }
/** * {@inheritDoc} */ @Override public Object get(String key, Object defaultValue) { return properties.getOrDefault(key, defaultValue); } }