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

com.tools20022.metamodel.MMDecimal Maven / Gradle / Ivy

The newest version!
/* Tools20022 - API for ISO 20022
* Copyright (C) 2017 Tools20022.com - László Bukodi 
* 
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
* 
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see .
*/

package com.tools20022.metamodel;

import com.tools20022.core.metamodel.Metamodel.MetamodelAttribute;
import com.tools20022.core.metamodel.Metamodel.MetamodelType;
import static com.tools20022.core.metamodel.StaticMemembersBuilder.newAttribute;
import com.tools20022.metamodel.*;
import java.util.Collections;
import java.util.Date;
import java.util.function.Supplier;
import java.util.List;
import java.util.Optional;

/**
 * Any set of values drawn from the value space of 'decimal', as specified by
 * W3C Recommendation XML Schema Part 2: Datatypes
 */
public class MMDecimal implements MMDataType {

	/**
	 * the lowest value in the allowed set of values
	 */
	public final static MetamodelAttribute> minInclusiveAttribute = newAttribute();
	/**
	 * the lowest but one value in the allowed set of values
	 */
	public final static MetamodelAttribute> minExclusiveAttribute = newAttribute();
	/**
	 * the highest value in the allowed set of values
	 */
	public final static MetamodelAttribute> maxInclusiveAttribute = newAttribute();
	/**
	 * the highest but one value in the allowed set of values
	 */
	public final static MetamodelAttribute> maxExclusiveAttribute = newAttribute();
	/**
	 * the maximum number of allowed digits in a Decimal number
	 */
	public final static MetamodelAttribute> totalDigitsAttribute = newAttribute();
	/**
	 * the fractional part of a Decimal number
	 */
	public final static MetamodelAttribute> fractionDigitsAttribute = newAttribute();
	/**
	 * A constraint on the value space of a datatype which is achieved by
	 * constraining the lexical space to literals which match a specific
	 * pattern.
	 */
	public final static MetamodelAttribute> patternAttribute = newAttribute();
	protected String minInclusive;
	protected String minExclusive;
	protected String maxInclusive;
	protected String maxExclusive;
	protected Integer totalDigits;
	protected Integer fractionDigits;
	protected String pattern;
	protected Supplier dataDictionary_lazy;
	protected String name;
	protected String definition;
	protected Supplier> semanticMarkup_lazy;
	protected Supplier> doclet_lazy;
	protected List example;
	protected Supplier> constraint_lazy;
	protected MMRegistrationStatus registrationStatus;
	protected Date removalDate;
	protected Supplier> nextVersions_lazy;
	protected Supplier previousVersion_lazy;
	protected String objectIdentifier;

	@Override
	public MMDataDictionary getContainer() {
		return getDataDictionary();
	}

	@Override
	public MetamodelType getMetamodel() {
		return StandardMetamodel2013.metamodel().getTypeByClass(getClass());
	}

	public static MetamodelType metaType() {
		return StandardMetamodel2013.metamodel().getTypeByClass(MMDecimal.class);
	}

	/**
	 * the lowest value in the allowed set of values
	 */
	public Optional getMinInclusive() {
		return minInclusive == null ? Optional.empty() : Optional.of(minInclusive);
	}

	/**
	 * the lowest but one value in the allowed set of values
	 */
	public Optional getMinExclusive() {
		return minExclusive == null ? Optional.empty() : Optional.of(minExclusive);
	}

	/**
	 * the highest value in the allowed set of values
	 */
	public Optional getMaxInclusive() {
		return maxInclusive == null ? Optional.empty() : Optional.of(maxInclusive);
	}

	/**
	 * the highest but one value in the allowed set of values
	 */
	public Optional getMaxExclusive() {
		return maxExclusive == null ? Optional.empty() : Optional.of(maxExclusive);
	}

	/**
	 * the maximum number of allowed digits in a Decimal number
	 */
	public Optional getTotalDigits() {
		return totalDigits == null ? Optional.empty() : Optional.of(totalDigits);
	}

	/**
	 * the fractional part of a Decimal number
	 */
	public Optional getFractionDigits() {
		return fractionDigits == null ? Optional.empty() : Optional.of(fractionDigits);
	}

	/**
	 * A constraint on the value space of a datatype which is achieved by
	 * constraining the lexical space to literals which match a specific
	 * pattern.
	 */
	public Optional getPattern() {
		return pattern == null ? Optional.empty() : Optional.of(pattern);
	}

	@Override
	public MMDataDictionary getDataDictionary() {
		return dataDictionary_lazy.get();
	}

	@Override
	public String getName() {
		return name;
	}

	@Override
	public Optional getDefinition() {
		return definition == null ? Optional.empty() : Optional.of(definition);
	}

	@Override
	public List getSemanticMarkup() {
		return semanticMarkup_lazy == null ? Collections.emptyList() : semanticMarkup_lazy.get();
	}

	@Override
	public List getDoclet() {
		return doclet_lazy == null ? Collections.emptyList() : doclet_lazy.get();
	}

	@Override
	public List getExample() {
		return example == null ? Collections.emptyList() : example;
	}

	@Override
	public List getConstraint() {
		return constraint_lazy == null ? Collections.emptyList() : constraint_lazy.get();
	}

	@Override
	public MMRegistrationStatus getRegistrationStatus() {
		return registrationStatus;
	}

	@Override
	public Optional getRemovalDate() {
		return removalDate == null ? Optional.empty() : Optional.of(removalDate);
	}

	@Override
	public List getNextVersions() {
		return nextVersions_lazy == null ? Collections.emptyList() : nextVersions_lazy.get();
	}

	@Override
	public Optional getPreviousVersion() {
		return previousVersion_lazy == null ? Optional.empty() : Optional.of(previousVersion_lazy.get());
	}

	@Override
	public Optional getObjectIdentifier() {
		return objectIdentifier == null ? Optional.empty() : Optional.of(objectIdentifier);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy