Home / Class/ Update Class — spring-boot Architecture

Update Class — spring-boot Architecture

Architecture documentation for the Update class in ContainerConfig.java from the spring-boot codebase.

Entity Profile

Relationship Graph

Source Code

buildpack/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/type/ContainerConfig.java lines 112–213

	public static class Update {

		private final ImageReference image;

		private @Nullable String user;

		private @Nullable String command;

		private final List<String> args = new ArrayList<>();

		private final Map<String, String> labels = new LinkedHashMap<>();

		private final List<Binding> bindings = new ArrayList<>();

		private final Map<String, String> env = new LinkedHashMap<>();

		private @Nullable String networkMode;

		private final List<String> securityOptions = new ArrayList<>();

		Update(ImageReference image) {
			this.image = image;
		}

		private ContainerConfig run(Consumer<Update> update) {
			update.accept(this);
			Assert.state(this.command != null, "'command' must not be null");
			return new ContainerConfig(this.user, this.image, this.command, this.args, this.labels, this.bindings,
					this.env, this.networkMode, this.securityOptions);
		}

		/**
		 * Update the container config with a specific user.
		 * @param user the user to set
		 */
		public void withUser(String user) {
			this.user = user;
		}

		/**
		 * Update the container config with a specific command.
		 * @param command the command to set
		 * @param args additional arguments to add
		 * @see #withArgs(String...)
		 */
		public void withCommand(String command, String... args) {
			this.command = command;
			withArgs(args);
		}

		/**
		 * Update the container config with additional args.
		 * @param args the arguments to add
		 */
		public void withArgs(String... args) {
			this.args.addAll(Arrays.asList(args));
		}

		/**
		 * Update the container config with an additional label.
		 * @param name the label name
		 * @param value the label value
		 */
		public void withLabel(String name, String value) {
			this.labels.put(name, value);
		}

		/**
		 * Update the container config with an additional binding.
		 * @param binding the binding
		 */
		public void withBinding(Binding binding) {
			this.bindings.add(binding);
		}

		/**
		 * Update the container config with an additional environment variable.
		 * @param name the variable name
		 * @param value the variable value
		 */
		public void withEnv(String name, String value) {
			this.env.put(name, value);
		}

		/**
		 * Update the container config with the network that the build container will
		 * connect to.
		 * @param networkMode the network
		 */
		public void withNetworkMode(@Nullable String networkMode) {
			this.networkMode = networkMode;
		}

		/**
		 * Update the container config with a security option.
		 * @param option the security option
		 */
		public void withSecurityOption(String option) {
			this.securityOptions.add(option);
		}

	}

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free