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

org.hisrc.jsonix.definition.Module Maven / Gradle / Ivy

There is a newer version: 2.3.9
Show newest version
package org.hisrc.jsonix.definition;

import java.text.MessageFormat;
import java.util.List;

import org.apache.commons.lang3.Validate;

public class Module {

	private final String name;
	private final String schemaId;
	private final List> mappings;
	private final List outputs;
	private final List jsonSchemas;

	public Module(String name, String schemaId, List> mappings,
			List outputs, List jsonSchemas) {
		Validate.notNull(name);
		Validate.notNull(schemaId);
		Validate.noNullElements(mappings);
		Validate.noNullElements(outputs);
		Validate.noNullElements(jsonSchemas);
		this.name = name;
		this.schemaId = schemaId;
		this.mappings = mappings;
		this.outputs = outputs;
		this.jsonSchemas = jsonSchemas;
	}

	public boolean isEmpty() {
		for (Mapping mapping : getMappings()) {
			if (!mapping.isEmpty()) {
				return false;
			}
		}
		return true;
	}

	public String getName() {
		return name;
	}
	
	public String getSchemaId() {
		return schemaId;
	}

	public List> getMappings() {
		return mappings;
	}

	public List getOutputs() {
		return outputs;
	}

	public List getJsonSchemas() {
		return jsonSchemas;
	}

	@Override
	public String toString() {
		return MessageFormat.format("Module [{0}].", this.name);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy