@Test void canBuildCommandWithOptionals() { final Command.Builder builder = new Command.Builder(NAME, USER, VERSION, CommandStatus.ACTIVE, EXECUTABLE_AND_ARGS, CHECK_DELAY); final String setupFile = UUID.randomUUID().toString(); builder.withSetupFile(setupFile); final Set<String> configs = Sets.newHashSet(UUID.randomUUID().toString(), UUID.randomUUID().toString()); builder.withConfigs(configs); final Set<String> dependencies = Sets.newHashSet(UUID.randomUUID().toString(), UUID.randomUUID().toString()); builder.withDependencies(dependencies); final Instant created = Instant.now(); builder.withCreated(created); final String description = UUID.randomUUID().toString(); builder.withDescription(description); final String id = UUID.randomUUID().toString(); builder.withId(id); final Set<String> tags = Sets.newHashSet(UUID.randomUUID().toString(), UUID.randomUUID().toString()); builder.withTags(tags); final Instant updated = Instant.now(); builder.withUpdated(updated); builder.withMemory(MEMORY); final List<Criterion> clusterCriteria = Lists.newArrayList( new Criterion.Builder().withId(UUID.randomUUID().toString()).build(), new Criterion.Builder().withName(UUID.randomUUID().toString()).build(), new Criterion.Builder().withStatus(UUID.randomUUID().toString()).build(), new Criterion.Builder().withVersion(UUID.randomUUID().toString()).build(), new Criterion.Builder().withTags(Sets.newHashSet(UUID.randomUUID().toString())).build() ); builder.withClusterCriteria(clusterCriteria); final Command command = builder.build(); Assertions.assertThat(command.getName()).isEqualTo(NAME); Assertions.assertThat(command.getUser()).isEqualTo(USER); Assertions.assertThat(command.getVersion()).isEqualTo(VERSION); Assertions.assertThat(command.getStatus()).isEqualTo(CommandStatus.ACTIVE); Assertions.assertThat(command.getExecutable()).isEqualTo(EXECUTABLE); Assertions.assertThat(command.getExecutableAndArguments()).isEqualTo(EXECUTABLE_AND_ARGS); Assertions.assertThat(command.getCheckDelay()).isEqualTo(CHECK_DELAY); Assertions.assertThat(command.getSetupFile()).isPresent().contains(setupFile); Assertions.assertThat(command.getConfigs()).isEqualTo(configs); Assertions.assertThat(command.getDependencies()).isEqualTo(dependencies); Assertions.assertThat(command.getCreated()).isPresent().contains(created); Assertions.assertThat(command.getDescription()).isPresent().contains(description); Assertions.assertThat(command.getId()).isPresent().contains(id); Assertions.assertThat(command.getTags()).isEqualTo(tags); Assertions.assertThat(command.getUpdated()).isPresent().contains(updated); Assertions.assertThat(command.getMemory()).isPresent().contains(MEMORY); Assertions.assertThat(command.getClusterCriteria()).isEqualTo(clusterCriteria); }
public Optional<Integer> getMemory() { return Optional.ofNullable(this.memory); }
Command extends ExecutionEnvironmentDTO { public Optional<Integer> getMemory() { return Optional.ofNullable(this.memory); } }
Command extends ExecutionEnvironmentDTO { public Optional<Integer> getMemory() { return Optional.ofNullable(this.memory); } protected  Command(@Valid final Builder builder); }
Command extends ExecutionEnvironmentDTO { public Optional<Integer> getMemory() { return Optional.ofNullable(this.memory); } protected  Command(@Valid final Builder builder); Optional<Integer> getMemory(); }
Command extends ExecutionEnvironmentDTO { public Optional<Integer> getMemory() { return Optional.ofNullable(this.memory); } protected  Command(@Valid final Builder builder); Optional<Integer> getMemory(); static final long DEFAULT_CHECK_DELAY; }