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

com.anaptecs.jeaf.junit.openapi.base.ChildB Maven / Gradle / Ivy

/*
 * anaptecs GmbH, Ricarda-Huch-Str. 71, 72760 Reutlingen, Germany
 *
 * Copyright 2004 - 2021. All rights reserved.
 */
package com.anaptecs.jeaf.junit.openapi.base;

import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.annotation.processing.Generated;
import javax.validation.ConstraintViolationException;
import javax.validation.constraints.Size;

import com.anaptecs.jeaf.junit.extension.BuilderPropertyDeclaration;
import com.anaptecs.jeaf.junit.extension.ClassPropertyDeclaration;
import com.anaptecs.jeaf.tools.api.validation.ValidationTools;
import com.anaptecs.jeaf.xfun.api.checks.Check;

@Generated("Before Class Declaration. Here an annontation cloud be added.")
/**
 * Multi
* line
* class
* comment * * @author JEAF Generator * @version JEAF Release 1.6.x */ public class ChildB extends ParentClass { /** * Default serial version uid. */ private static final long serialVersionUID = 1L; /** * Constant for the name of attribute "childBAttribute". */ public static final String CHILDBATTRIBUTE = "childBAttribute"; /** * Constant for the name of attribute "composition". */ public static final String COMPOSITION = "composition"; // "boolean" @ClassPropertyDeclaration /** * A child attribute */ @Size(min = 11, max = 42) private boolean[] childBAttribute; // "boolean" private int childBAttributeXYZ = 0; // "com.anaptecs.jeaf.junit.openapi.base.ParentClass" @ClassPropertyDeclaration /** * the composition */ private Set composition; // "com.anaptecs.jeaf.junit.openapi.base.ParentClass" private int compositionXYZ = 0; /** * Default constructor is only intended to be used for deserialization by tools like Jackson for JSON. For "normal" * object creation builder should be used instead. */ protected ChildB( ) { composition = new HashSet(); } /** * Initialize object using the passed builder. * * @param pBuilder Builder that should be used to initialize this object. The parameter must not be null. */ protected ChildB( Builder pBuilder ) { // Call constructor of super class. super(pBuilder); // Read attribute values from builder. childBAttribute = pBuilder.childBAttribute; // "boolean" childBAttributeXYZ = pBuilder.childBAttributeXYZ; if (pBuilder.composition != null) { composition = pBuilder.composition; } else { composition = new HashSet(); } // "com.anaptecs.jeaf.junit.openapi.base.ParentClass" compositionXYZ = pBuilder.compositionXYZ; } /** * Method returns a new builder. * * @return {@link Builder} New builder that can be used to create new ChildB objects. */ public static Builder builder( ) { return new Builder(); } /** * Class implements builder to create a new instance of class ChildB. */ public static class Builder extends ParentClass.Builder { /** * A child attribute */ // "boolean" @BuilderPropertyDeclaration @Size(min = 11, max = 42) private boolean[] childBAttribute; // "boolean" private int childBAttributeXYZ = 0; /** * the composition */ // "com.anaptecs.jeaf.junit.openapi.base.ParentClass" @BuilderPropertyDeclaration private Set composition; // "com.anaptecs.jeaf.junit.openapi.base.ParentClass" private int compositionXYZ = 0; /** * Use {@link ChildB#builder()} instead of private constructor to create new builder. */ protected Builder( ) { super(); } /** * Use {@link ChildB#builder(ChildB)} instead of private constructor to create new builder. */ protected Builder( ChildB pObject ) { super(pObject); if (pObject != null) { // Read attribute values from passed object. this.setChildBAttribute(pObject.childBAttribute); this.setComposition(pObject.composition); } } /** * Method sets attribute {@link #parentAttribute}.
* * @param pParentAttribute Value to which {@link #parentAttribute} should be set. * @return {@link Builder} Instance of this builder to support chaining setters. Method never returns null. */ @Override public Builder setParentAttribute( String pParentAttribute ) { // Call super class implementation. super.setParentAttribute(pParentAttribute); return this; } /** * Method sets association {@link #ibans}.
* * @param pIbans Collection to which {@link #ibans} should be set. * @return {@link Builder} Instance of this builder to support chaining setters. Method never returns null. */ @Override public Builder setIbans( Set pIbans ) { // Call super class implementation. super.setIbans(pIbans); return this; } /** * Method adds the passed objects to association {@link #ibans}.
* * @param pIbans Array of objects that should be added to {@link #ibans}. The parameter may be null. * @return {@link Builder} Instance of this builder to support chaining. Method never returns null. */ public Builder addToIbans( IBAN... pIbans ) { // Call super class implementation. super.addToIbans(pIbans); return this; } /** * Method sets association {@link #theBankAccount}.
* * @param pTheBankAccount Value to which {@link #theBankAccount} should be set. * @return {@link Builder} Instance of this builder to support chaining setters. Method never returns null. */ @Deprecated @Override public Builder setTheBankAccount( BankAccount pTheBankAccount ) { // Call super class implementation. super.setTheBankAccount(pTheBankAccount); return this; } /** * Method sets association {@link #legacyBankAccounts}.
* * @param pLegacyBankAccounts Collection to which {@link #legacyBankAccounts} should be set. * @return {@link Builder} Instance of this builder to support chaining setters. Method never returns null. */ @Deprecated @Override public Builder setLegacyBankAccounts( List pLegacyBankAccounts ) { // Call super class implementation. super.setLegacyBankAccounts(pLegacyBankAccounts); return this; } /** * Method adds the passed objects to association {@link #legacyBankAccounts}.
* * @param pLegacyBankAccounts Array of objects that should be added to {@link #legacyBankAccounts}. The parameter * may be null. * @return {@link Builder} Instance of this builder to support chaining. Method never returns null. */ @Deprecated public Builder addToLegacyBankAccounts( BankAccount... pLegacyBankAccounts ) { // Call super class implementation. super.addToLegacyBankAccounts(pLegacyBankAccounts); return this; } /** * Method sets attribute {@link #childBAttribute}.
* * @param pChildBAttribute Value to which {@link #childBAttribute} should be set. * @return {@link Builder} Instance of this builder to support chaining setters. Method never returns null. */ public Builder setChildBAttribute( boolean[] pChildBAttribute ) { // Assign value to attribute if (pChildBAttribute != null) { childBAttribute = new boolean[pChildBAttribute.length]; System.arraycopy(pChildBAttribute, 0, childBAttribute, 0, pChildBAttribute.length); } else { childBAttribute = null; } return this; } public Builder setChildBAttributeXYZ( int value ) { // "boolean" childBAttributeXYZ = value; return this; } /** * Method sets association {@link #composition}.
* * @param pComposition Collection to which {@link #composition} should be set. * @return {@link Builder} Instance of this builder to support chaining setters. Method never returns null. */ public Builder setComposition( Set pComposition ) { // To ensure immutability we have to copy the content of the passed collection. if (pComposition != null) { composition = new HashSet(pComposition); } else { composition = null; } return this; } /** * Method adds the passed objects to association {@link #composition}.
* * @param pComposition Array of objects that should be added to {@link #composition}. The parameter may be null. * @return {@link Builder} Instance of this builder to support chaining. Method never returns null. */ public Builder addToComposition( ParentClass... pComposition ) { if (pComposition != null) { if (composition == null) { composition = new HashSet(); } composition.addAll(Arrays.asList(pComposition)); } return this; } public Builder setCompositionXYZ( int value ) { // "com.anaptecs.jeaf.junit.openapi.base.ParentClass" compositionXYZ = value; return this; } // Ooops, I also forgot to implement that for our builders ;-( /** * Method creates a new instance of class ChildB. The object will be initialized with the values of the builder. * * @return ChildB Created object. The method never returns null. */ public ChildB build( ) { return new ChildB(this); } /** * Method creates a new validated instance of class ChildB. The object will be initialized with the values of the * builder and validated afterwards. * * @return ChildB Created and validated object. The method never returns null. * @throws ConstraintViolationException in case that one or more validations for the created object failed. */ public ChildB buildValidated( ) throws ConstraintViolationException { ChildB lObject = this.build(); ValidationTools.getValidationTools().enforceObjectValidation(lObject); return lObject; } } /** * Method returns attribute {@link #childBAttribute}.
* A child attribute * * @return boolean[] Value to which {@link #childBAttribute} is set. */ public boolean[] getChildBAttribute( ) { boolean[] lReturnValue; if (childBAttribute != null) { lReturnValue = new boolean[childBAttribute.length]; System.arraycopy(childBAttribute, 0, lReturnValue, 0, childBAttribute.length); } else { lReturnValue = null; } return lReturnValue; } /** * Method sets attribute {@link #childBAttribute}.
* A child attribute * * @param pChildBAttribute Value to which {@link #childBAttribute} should be set. */ public void setChildBAttribute( boolean[] pChildBAttribute ) { // Assign value to attribute if (pChildBAttribute != null) { childBAttribute = new boolean[pChildBAttribute.length]; System.arraycopy(pChildBAttribute, 0, childBAttribute, 0, pChildBAttribute.length); } else { childBAttribute = null; } } public int getChildBAttributeXYZ( ) { // "boolean" return childBAttributeXYZ; } public void setChildBAttributeXYZ( int value ) { childBAttributeXYZ = value; } /** * Method returns association {@link #composition}.
* the composition * * @return {@link Set} Value to which {@link #composition} is set. The method never returns null and the * returned collection is unmodifiable. */ public Set getComposition( ) { // Return all ParentClass objects as unmodifiable collection. return Collections.unmodifiableSet(composition); } /** * Method adds the passed object to {@link #composition}. * * @param pComposition Object that should be added to {@link #composition}. The parameter must not be null. */ public void addToComposition( ParentClass pComposition ) { // Check parameter "pComposition" for invalid value null. Check.checkInvalidParameterNull(pComposition, "pComposition"); // Add passed object to collection of associated ParentClass objects. composition.add(pComposition); } /** * Method adds all passed objects to {@link #composition}. * * @param pComposition Collection with all objects that should be added to {@link #composition}. The parameter must * not be null. */ public void addToComposition( Collection pComposition ) { // Check parameter "pComposition" for invalid value null. Check.checkInvalidParameterNull(pComposition, "pComposition"); // Add all passed objects. for (ParentClass lNextObject : pComposition) { this.addToComposition(lNextObject); } } /** * Method removes the passed object from {@link #composition}.
* * @param pComposition Object that should be removed from {@link #composition}. The parameter must not be null. */ public void removeFromComposition( ParentClass pComposition ) { // Check parameter for invalid value null. Check.checkInvalidParameterNull(pComposition, "pComposition"); // Remove passed object from collection of associated ParentClass objects. composition.remove(pComposition); } /** * Method removes all objects from {@link #composition}. */ public void clearComposition( ) { // Remove all objects from association "composition". composition.clear(); } public int getCompositionXYZ( ) { // "com.anaptecs.jeaf.junit.openapi.base.ParentClass" return compositionXYZ; } public void setCompositionXYZ( int value ) { compositionXYZ = value; } public void doSomethingGenerated( ) { // Ooops, I forget to implement that ;-) } /** * Method creates a new builder and initializes it with the data of this object. * * @return {@link Builder} New builder that can be used to create new ChildB objects. The method never returns null. */ public Builder toBuilder( ) { return new Builder(this); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy