io.deepsense.neptune.clientlibrary.models.impl.parameters.OfflineJobParameters Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neptune-client-library Show documentation
Show all versions of neptune-client-library Show documentation
Enables integration with Neptune in your Java code
/**
* Copyright (c) 2016, CodiLime Inc.
*/
package io.deepsense.neptune.clientlibrary.models.impl.parameters;
import io.deepsense.neptune.clientlibrary.models.JobParameters;
import io.deepsense.neptune.clientlibrary.models.Parameter;
import java.util.*;
public class OfflineJobParameters extends HashMap implements JobParameters {
public OfflineJobParameters put(String name, String value) {
put(name, ParameterImpl.createStringParameter(name, value));
return this;
}
public OfflineJobParameters put(String name, Integer value) {
put(name, ParameterImpl.createIntParameter(name, value));
return this;
}
public OfflineJobParameters put(String name, Double value) {
put(name, ParameterImpl.createDoubleParameter(name, value));
return this;
}
public OfflineJobParameters put(String name, Boolean value) {
put(name, ParameterImpl.createBooleanParameter(name, value));
return this;
}
@Override
public Parameter get(Object key) {
if (!containsKey(key)) {
System.err.format("neptune: Trying to access the '%s' parameter which is not defined.%n"
+ " In order to run a Neptune job offline, you need to provide all parameters%n"
+ " via command line or JobParameters argument of NeptuneContextFactory.createContext.",
key);
}
return super.get(key);
}
public static JobParameters emptyParameters() {
return new OfflineJobParameters();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy