/** * Creates a new instance with the given state * * @param name the operation's name. Cannot be blank * @param description the operation's descriptor * @param executorFactory a {@link OperationExecutorFactory}. Cannot be {@code null} * @param parameters a {@link List} with the operation's {@link Parameter}s * @param capabilities a {@link Set} with the operation's capabilities */ ImmutableOperation(String name, String description, OperationExecutorFactory executorFactory, List<Parameter> parameters, Set<Object> capabilities) { super(name, description, capabilities); checkArgument(executorFactory != null, String.format("Operation '%s' cannot have a null executor factory", name)); this.executorFactory = executorFactory; this.parameters = immutableList(parameters); }
/** * Creates a new instance with the given state * * @param name the configuration's name * @param description the configuration's description * @param instantiator the {@link ConfigurationInstantiator}. Cannot be {@code null} * @param parameters a {@link List} with the configuration's {@link Parameter}s * @param capabilities a {@link Set} with the configuration's capabilities */ protected ImmutableConfiguration(String name, String description, ConfigurationInstantiator instantiator, List<Parameter> parameters, Set<Object> capabilities) { super(name, description, capabilities); validateRepeatedNames(parameters); checkArgument(instantiator != null, "instantiator cannot be null"); this.parameters = immutableList(parameters); this.instantiator = instantiator; }