Home / Class/ ContainerPort Class — spring-boot Architecture

ContainerPort Class — spring-boot Architecture

Architecture documentation for the ContainerPort class in DefaultConnectionPorts.java from the spring-boot codebase.

Entity Profile

Source Code

core/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/core/DefaultConnectionPorts.java lines 133–151

	record ContainerPort(int number, String protocol) {

		@Override
		public String toString() {
			return "%d/%s".formatted(this.number, this.protocol);
		}

		static ContainerPort parse(String value) {
			try {
				String[] parts = value.split("/");
				Assert.state(parts.length == 2, "Unable to split string");
				return new ContainerPort(Integer.parseInt(parts[0]), parts[1]);
			}
			catch (RuntimeException ex) {
				throw new IllegalStateException("Unable to parse container port '%s'".formatted(value), ex);
			}
		}

	}

Analyze Your Own Codebase

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

Try Supermodel Free