All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.mklinger.qetcher.client.model.v1.impl.AvailabilityImpl Maven / Gradle / Ivy

The newest version!
package de.mklinger.qetcher.client.model.v1.impl;

import java.util.Objects;

import de.mklinger.qetcher.client.model.v1.Availability;
import de.mklinger.qetcher.client.model.v1.ModelValidationException;
import de.mklinger.qetcher.client.model.v1.builder.AvailabilityBuilder;

/**
 * @author Marc Klinger - mklinger[at]mklinger[dot]de
 */
public class AvailabilityImpl implements Availability {
	private final String nodeId;
	private final String converterId;

	public AvailabilityImpl(final AvailabilityBuilder builder) {
		this.nodeId = builder.getNodeId();
		this.converterId = builder.getConverterId();

		try {
			validate();
		} catch (final Exception e) {
			throw new ModelValidationException(Availability.class, e);
		}
	}

	private void validate() {
		Objects.requireNonNull(nodeId);
		Objects.requireNonNull(converterId);
	}

	@Override
	public String getNodeId() {
		return nodeId;
	}

	@Override
	public String getConverterId() {
		return converterId;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy