Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2014-2014 The Kuali Foundation Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.opensource.org/licenses/ecl2.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 package org.kuali.common.core.system;
 
 import static org.kuali.common.core.system.VirtualSystemHelper.createVirtualSystem;
 
 
 
Strongly typed and immutable version of java.lang.System.getProperties()
 
 public final class VirtualSystem {
 
 	private final User user;
 	private final OperatingSystem os;
 	private final Java java;
 	private final String lineSeparator;
 	private final String pathSeparator;
 	private final String fileSeparator;
 	private final ImmutableProperties properties;
 	private final ImmutableProperties environment;

Create a new immutable VirtualSystem instance representing the current state of the system we are running on.
 
 	public static VirtualSystem create() {
 		return build();
 	}

Create a new immutable VirtualSystem instance representing the current state of the system we are running on.
 
 	public static VirtualSystem build() {
 		return createVirtualSystem();
 	}
 
 	public static Builder builder() {
 		return new Builder();
 	}
 
 	private VirtualSystem(Builder builder) {
 		this. = builder.user;
 		this. = builder.os;
 		this. = builder.java;
 		this. = builder.lineSeparator;
 		this. = builder.pathSeparator;
 		this. = builder.fileSeparator;
 		this. = ImmutableProperties.copyOf(builder.properties);
 		this. = ImmutableProperties.copyOf(builder.environment);
 	}
 
 	public static class Builder extends ValidatingBuilder<VirtualSystem> {
 
 		private User user = User.build();
 		private OperatingSystem os = OperatingSystem.build();
 		private Java java;
 		private String lineSeparator = System.getProperty("line.separator");
 		private String pathSeparator = System.getProperty("path.separator");
 		private String fileSeparator = System.getProperty("file.separator");
 		private Properties properties = ImmutableProperties.copyOf(System.getProperties());
 		private Properties environment = ImmutableProperties.copyOf(System.getenv());
 
 		public Builder withUser(User user) {
 			this. = user;
 			return this;
 		}
 
 		public Builder withOs(OperatingSystem os) {
 			this. = os;
 			return this;
 		}
 
 		public Builder withJava(Java java) {
 			this. = java;
 			return this;
 		}
		public Builder withLineSeparator(String lineSeparator) {
			this. = lineSeparator;
			return this;
		}
		public Builder withPathSeparator(String pathSeparator) {
			this. = pathSeparator;
			return this;
		}
		public Builder withFileSeparator(String fileSeparator) {
			this. = fileSeparator;
			return this;
		}
		public Builder withProperties(Properties properties) {
			this. = properties;
			return this;
		}
		public Builder withEnvironment(Properties environment) {
			this. = environment;
			return this;
		}
		public VirtualSystem build() {
			return validate(new VirtualSystem(this));
		}
	}
	public User getUser() {
		return ;
	}
	public OperatingSystem getOs() {
		return ;
	}
	public Java getJava() {
		return ;
	}
	}
	}
	}
		return ;
	}
		return ;
	}
New to GrepCode? Check out our FAQ X