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

org.javastro.ivoa.entities.resource.Validation Maven / Gradle / Ivy


package org.javastro.ivoa.entities.resource;

import java.math.BigInteger;
import java.util.HashMap;
import java.util.Map;
import javax.xml.namespace.QName;
import com.kscs.util.jaxb.Buildable;
import com.kscs.util.jaxb.Copyable;
import com.kscs.util.jaxb.PartialCopyable;
import com.kscs.util.jaxb.PropertyTree;
import com.kscs.util.jaxb.PropertyTreeUse;
import com.kscs.util.jaxb.PropertyVisitor;
import com.kscs.util.jaxb.SingleProperty;
import com.kscs.util.jaxb.SinglePropertyInfo;
import com.kscs.util.jaxb.SinglePropertyInfo;
import com.kscs.util.jaxb.SinglePropertyInfo;
import jakarta.annotation.Generated;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlSchemaType;
import jakarta.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.XmlValue;
import org.jvnet.jaxb.lang.JAXBMergeStrategy;
import org.jvnet.jaxb.lang.JAXBToStringStrategy;
import org.jvnet.jaxb.lang.MergeFrom;
import org.jvnet.jaxb.lang.MergeStrategy;
import org.jvnet.jaxb.lang.ToString;
import org.jvnet.jaxb.lang.ToStringStrategy;
import org.jvnet.jaxb.locator.ObjectLocator;
import org.jvnet.jaxb.locator.util.LocatorUtils;


/**
 * a validation stamp combining a validation level and the ID of 
 *          the validator.
 * 
 * 

Java class for Validation complex type

. * *

The following schema fragment specifies the expected content contained within this class.

* *
{@code
 * 
 *   
 *     
 *       
 *     
 *   
 * 
 * }
* * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Validation", propOrder = { "value" }) @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public class Validation implements Cloneable, Copyable, PartialCopyable, MergeFrom, ToString { /** * See the RM (v1.1, section 4) for more guidance on the use of * these values. * */ @XmlValue @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") protected BigInteger value; /** * The IVOA ID of the registry or organisation that * assigned the validation level. * */ @XmlAttribute(name = "validatedBy", required = true) @XmlSchemaType(name = "anyURI") @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") protected String validatedBy; @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") protected transient Validation.Modifier __cachedModifier__; /** * Default no-arg constructor * */ public Validation() { super(); } /** * Fully-initialising value constructor * */ public Validation(final BigInteger value, final String validatedBy) { this.value = value; this.validatedBy = validatedBy; } /** * See the RM (v1.1, section 4) for more guidance on the use of * these values. * * @return * possible object is * {@link BigInteger } * */ @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public BigInteger getValue() { return value; } /** * Sets the value of the value property. * * @param value * allowed object is * {@link BigInteger } * * @see #getValue() */ @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public void setValue(BigInteger value) { this.value = value; } /** * The IVOA ID of the registry or organisation that * assigned the validation level. * * @return * possible object is * {@link String } * */ @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public String getValidatedBy() { return validatedBy; } /** * Sets the value of the validatedBy property. * * @param value * allowed object is * {@link String } * * @see #getValidatedBy() */ @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public void setValidatedBy(String value) { this.validatedBy = value; } @Override @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public boolean equals(Object object) { if ((object == null)||(this.getClass()!= object.getClass())) { return false; } if (this == object) { return true; } final Validation that = ((Validation) object); { BigInteger leftValue; leftValue = this.getValue(); BigInteger rightValue; rightValue = that.getValue(); if (this.value!= null) { if (that.value!= null) { if (!leftValue.equals(rightValue)) { return false; } } else { return false; } } else { if (that.value!= null) { return false; } } } { String leftValidatedBy; leftValidatedBy = this.getValidatedBy(); String rightValidatedBy; rightValidatedBy = that.getValidatedBy(); if (this.validatedBy!= null) { if (that.validatedBy!= null) { if (!leftValidatedBy.equals(rightValidatedBy)) { return false; } } else { return false; } } else { if (that.validatedBy!= null) { return false; } } } return true; } @Override @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public int hashCode() { int currentHashCode = 1; { currentHashCode = (currentHashCode* 31); BigInteger theValue; theValue = this.getValue(); if (this.value!= null) { currentHashCode += theValue.hashCode(); } } { currentHashCode = (currentHashCode* 31); String theValidatedBy; theValidatedBy = this.getValidatedBy(); if (this.validatedBy!= null) { currentHashCode += theValidatedBy.hashCode(); } } return currentHashCode; } @Override @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public String toString() { final ToStringStrategy strategy = JAXBToStringStrategy.getInstance(); final StringBuilder buffer = new StringBuilder(); append(null, buffer, strategy); return buffer.toString(); } @Override @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { strategy.appendStart(locator, this, buffer); appendFields(locator, buffer, strategy); strategy.appendEnd(locator, this, buffer); return buffer; } @Override @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { { BigInteger theValue; theValue = this.getValue(); strategy.appendField(locator, this, "value", buffer, theValue, (this.value!= null)); } { String theValidatedBy; theValidatedBy = this.getValidatedBy(); strategy.appendField(locator, this, "validatedBy", buffer, theValidatedBy, (this.validatedBy!= null)); } return buffer; } @Override @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public void mergeFrom(Object left, Object right) { final MergeStrategy strategy = JAXBMergeStrategy.getInstance(); mergeFrom(null, null, left, right, strategy); } @Override @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public void mergeFrom(ObjectLocator leftLocator, ObjectLocator rightLocator, Object left, Object right, MergeStrategy strategy) { if (right instanceof Validation) { final Validation target = this; final Validation leftObject = ((Validation) left); final Validation rightObject = ((Validation) right); { Boolean valueShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, (leftObject.value!= null), (rightObject.value!= null)); if (valueShouldBeMergedAndSet == Boolean.TRUE) { BigInteger lhsValue; lhsValue = leftObject.getValue(); BigInteger rhsValue; rhsValue = rightObject.getValue(); BigInteger mergedValue = ((BigInteger) strategy.merge(LocatorUtils.property(leftLocator, "value", lhsValue), LocatorUtils.property(rightLocator, "value", rhsValue), lhsValue, rhsValue, (leftObject.value!= null), (rightObject.value!= null))); target.setValue(mergedValue); } else { if (valueShouldBeMergedAndSet == Boolean.FALSE) { target.value = null; } } } { Boolean validatedByShouldBeMergedAndSet = strategy.shouldBeMergedAndSet(leftLocator, rightLocator, (leftObject.validatedBy!= null), (rightObject.validatedBy!= null)); if (validatedByShouldBeMergedAndSet == Boolean.TRUE) { String lhsValidatedBy; lhsValidatedBy = leftObject.getValidatedBy(); String rhsValidatedBy; rhsValidatedBy = rightObject.getValidatedBy(); String mergedValidatedBy = ((String) strategy.merge(LocatorUtils.property(leftLocator, "validatedBy", lhsValidatedBy), LocatorUtils.property(rightLocator, "validatedBy", rhsValidatedBy), lhsValidatedBy, rhsValidatedBy, (leftObject.validatedBy!= null), (rightObject.validatedBy!= null))); target.setValidatedBy(mergedValidatedBy); } else { if (validatedByShouldBeMergedAndSet == Boolean.FALSE) { target.validatedBy = null; } } } } } @Override @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public Object createNewInstance() { return new Validation(); } @Override @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public Validation clone() { final Validation _newObject; try { _newObject = ((Validation) super.clone()); } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } return _newObject; } @Override @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public Validation createCopy() { final Validation _newObject; try { _newObject = ((Validation) super.clone()); } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } _newObject.value = this.value; _newObject.validatedBy = this.validatedBy; return _newObject; } @Override @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public Validation createCopy(final PropertyTree _propertyTree, final PropertyTreeUse _propertyTreeUse) { final Validation _newObject; try { _newObject = ((Validation) super.clone()); } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } final PropertyTree valuePropertyTree = ((_propertyTree == null)?null:_propertyTree.get("value")); if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(valuePropertyTree!= null):((valuePropertyTree == null)||(!valuePropertyTree.isLeaf())))) { _newObject.value = this.value; } final PropertyTree validatedByPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("validatedBy")); if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(validatedByPropertyTree!= null):((validatedByPropertyTree == null)||(!validatedByPropertyTree.isLeaf())))) { _newObject.validatedBy = this.validatedBy; } return _newObject; } @Override @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public Validation copyExcept(final PropertyTree _propertyTree) { return createCopy(_propertyTree, PropertyTreeUse.EXCLUDE); } @Override @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public Validation copyOnly(final PropertyTree _propertyTree) { return createCopy(_propertyTree, PropertyTreeUse.INCLUDE); } @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public Validation.Modifier modifier() { if (null == this.__cachedModifier__) { this.__cachedModifier__ = new Validation.Modifier(); } return ((Validation.Modifier) this.__cachedModifier__); } /** * Copies all state of this object to a builder. This method is used by the copyOf * method and should not be called directly by client code. * * @param _other * A builder instance to which the state of this object will be copied. */ @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public<_B >void copyTo(final Validation.Builder<_B> _other) { _other.value = this.value; _other.validatedBy = this.validatedBy; } @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public<_B >Validation.Builder<_B> newCopyBuilder(final _B _parentBuilder) { return new Validation.Builder<_B>(_parentBuilder, this, true); } @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public Validation.Builder newCopyBuilder() { return newCopyBuilder(null); } @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public static Validation.Builder builder() { return new Validation.Builder<>(null, null, false); } @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public static<_B >Validation.Builder<_B> copyOf(final Validation _other) { final Validation.Builder<_B> _newBuilder = new Validation.Builder<>(null, null, false); _other.copyTo(_newBuilder); return _newBuilder; } /** * Copies all state of this object to a builder. This method is used by the copyOf * method and should not be called directly by client code. * * @param _other * A builder instance to which the state of this object will be copied. */ @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public<_B >void copyTo(final Validation.Builder<_B> _other, final PropertyTree _propertyTree, final PropertyTreeUse _propertyTreeUse) { final PropertyTree valuePropertyTree = ((_propertyTree == null)?null:_propertyTree.get("value")); if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(valuePropertyTree!= null):((valuePropertyTree == null)||(!valuePropertyTree.isLeaf())))) { _other.value = this.value; } final PropertyTree validatedByPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("validatedBy")); if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(validatedByPropertyTree!= null):((validatedByPropertyTree == null)||(!validatedByPropertyTree.isLeaf())))) { _other.validatedBy = this.validatedBy; } } @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public<_B >Validation.Builder<_B> newCopyBuilder(final _B _parentBuilder, final PropertyTree _propertyTree, final PropertyTreeUse _propertyTreeUse) { return new Validation.Builder<_B>(_parentBuilder, this, true, _propertyTree, _propertyTreeUse); } @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public Validation.Builder newCopyBuilder(final PropertyTree _propertyTree, final PropertyTreeUse _propertyTreeUse) { return newCopyBuilder(null, _propertyTree, _propertyTreeUse); } @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public static<_B >Validation.Builder<_B> copyOf(final Validation _other, final PropertyTree _propertyTree, final PropertyTreeUse _propertyTreeUse) { final Validation.Builder<_B> _newBuilder = new Validation.Builder<>(null, null, false); _other.copyTo(_newBuilder, _propertyTree, _propertyTreeUse); return _newBuilder; } @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public static Validation.Builder copyExcept(final Validation _other, final PropertyTree _propertyTree) { return copyOf(_other, _propertyTree, PropertyTreeUse.EXCLUDE); } @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public static Validation.Builder copyOnly(final Validation _other, final PropertyTree _propertyTree) { return copyOf(_other, _propertyTree, PropertyTreeUse.INCLUDE); } @Generated(value = "com.sun.tools.xjc.Driver", comments = "JAXB RI v4.0.4", date = "2024-10-20T18:15:02+01:00") public Validation visit(final PropertyVisitor _visitor_) { _visitor_.visit(this); _visitor_.visit(new SingleProperty<>(Validation.PropInfo.VALUE, this)); _visitor_.visit(new SingleProperty<>(Validation.PropInfo.VALIDATED_BY, this)); return this; } public static class Builder<_B >implements Buildable { protected final _B _parentBuilder; protected final Validation _storedValue; private BigInteger value; private String validatedBy; public Builder(final _B _parentBuilder, final Validation _other, final boolean _copy) { this._parentBuilder = _parentBuilder; if (_other!= null) { if (_copy) { _storedValue = null; this.value = _other.value; this.validatedBy = _other.validatedBy; } else { _storedValue = _other; } } else { _storedValue = null; } } public Builder(final _B _parentBuilder, final Validation _other, final boolean _copy, final PropertyTree _propertyTree, final PropertyTreeUse _propertyTreeUse) { this._parentBuilder = _parentBuilder; if (_other!= null) { if (_copy) { _storedValue = null; final PropertyTree valuePropertyTree = ((_propertyTree == null)?null:_propertyTree.get("value")); if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(valuePropertyTree!= null):((valuePropertyTree == null)||(!valuePropertyTree.isLeaf())))) { this.value = _other.value; } final PropertyTree validatedByPropertyTree = ((_propertyTree == null)?null:_propertyTree.get("validatedBy")); if (((_propertyTreeUse == PropertyTreeUse.INCLUDE)?(validatedByPropertyTree!= null):((validatedByPropertyTree == null)||(!validatedByPropertyTree.isLeaf())))) { this.validatedBy = _other.validatedBy; } } else { _storedValue = _other; } } else { _storedValue = null; } } public _B end() { return this._parentBuilder; } protected<_P extends Validation >_P init(final _P _product) { _product.value = this.value; _product.validatedBy = this.validatedBy; return _product; } /** * Sets the new value of "value" (any previous value will be replaced) * * @param value * New value of the "value" property. */ public Validation.Builder<_B> withValue(final BigInteger value) { this.value = value; return this; } /** * Sets the new value of "validatedBy" (any previous value will be replaced) * * @param validatedBy * New value of the "validatedBy" property. */ public Validation.Builder<_B> withValidatedBy(final String validatedBy) { this.validatedBy = validatedBy; return this; } @Override public Validation build() { if (_storedValue == null) { return this.init(new Validation()); } else { return ((Validation) _storedValue); } } public Validation.Builder<_B> copyOf(final Validation _other) { _other.copyTo(this); return this; } public Validation.Builder<_B> copyOf(final Validation.Builder _other) { return copyOf(_other.build()); } } public class Modifier { public void setValue(final BigInteger value) { Validation.this.setValue(value); } public void setValidatedBy(final String validatedBy) { Validation.this.setValidatedBy(validatedBy); } } public static class PropInfo { public static final transient SinglePropertyInfo VALUE = new SinglePropertyInfo("value", Validation.class, BigInteger.class, false, null, new QName("http://www.ivoa.net/xml/VOResource/v1.0", "ValidationLevel"), new QName("http://www.ivoa.net/xml/VOResource/v1.0", "ValidationLevel"), false) { @Override public BigInteger get(final Validation _instance_) { return ((_instance_ == null)?null:_instance_.value); } @Override public void set(final Validation _instance_, final BigInteger _value_) { if (_instance_!= null) { _instance_.value = _value_; } } } ; public static final transient SinglePropertyInfo VALIDATED_BY = new SinglePropertyInfo("validatedBy", Validation.class, String.class, false, null, new QName("", "validatedBy"), new QName("http://www.w3.org/2001/XMLSchema", "anyURI"), true) { @Override public String get(final Validation _instance_) { return ((_instance_ == null)?null:_instance_.validatedBy); } @Override public void set(final Validation _instance_, final String _value_) { if (_instance_!= null) { _instance_.validatedBy = _value_; } } } ; } public static class Select extends Validation.Selector { Select() { super(null, null, null); } public static Validation.Select _root() { return new Validation.Select(); } } public static class Selector , TParent > extends com.kscs.util.jaxb.Selector { private com.kscs.util.jaxb.Selector> value = null; private com.kscs.util.jaxb.Selector> validatedBy = null; public Selector(final TRoot root, final TParent parent, final String propertyName) { super(root, parent, propertyName); } @Override public Map buildChildren() { final Map products = new HashMap<>(); products.putAll(super.buildChildren()); if (this.value!= null) { products.put("value", this.value.init()); } if (this.validatedBy!= null) { products.put("validatedBy", this.validatedBy.init()); } return products; } public com.kscs.util.jaxb.Selector> value() { return ((this.value == null)?this.value = new com.kscs.util.jaxb.Selector<>(this._root, this, "value"):this.value); } public com.kscs.util.jaxb.Selector> validatedBy() { return ((this.validatedBy == null)?this.validatedBy = new com.kscs.util.jaxb.Selector<>(this._root, this, "validatedBy"):this.validatedBy); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy