Example #1
0
 public static Builder create(CountryContract cc) {
   Builder builder =
       new Builder(
           cc.getCode(), cc.getAlternateCode(), cc.getName(), cc.isRestricted(), cc.isActive());
   builder.setVersionNumber(cc.getVersionNumber());
   return builder;
 }
Example #2
0
 public static Builder create(MissedPunchContract contract) {
   if (contract == null) {
     throw new IllegalArgumentException("contract was null");
   }
   Builder builder = create();
   builder.setTask(contract.getTask());
   builder.setActionFullDateTime(contract.getActionFullDateTime());
   builder.setActionTime(contract.getActionTime());
   builder.setClockAction(contract.getClockAction());
   builder.setTkClockLogId(contract.getTkClockLogId());
   builder.setPrincipalName(contract.getPrincipalName());
   builder.setPersonName(contract.getPersonName());
   builder.setAssignmentReadOnly(contract.isAssignmentReadOnly());
   builder.setTkMissedPunchId(contract.getTkMissedPunchId());
   builder.setJobNumber(contract.getJobNumber());
   builder.setWorkArea(contract.getWorkArea());
   builder.setTimesheetDocumentId(contract.getTimesheetDocumentId());
   builder.setPrincipalId(contract.getPrincipalId());
   builder.setAssignmentKey(contract.getAssignmentKey());
   builder.setAssignmentValue(contract.getAssignmentValue());
   builder.setVersionNumber(contract.getVersionNumber());
   builder.setObjectId(contract.getObjectId());
   builder.setCreateTime(contract.getCreateTime());
   builder.setMissedPunchDocId(contract.getMissedPunchDocId());
   builder.setMissedPunchDocStatus(contract.getMissedPunchDocStatus());
   builder.setGroupKeyCode(contract.getGroupKeyCode());
   builder.setGroupKey(
       contract.getGroupKey() == null
           ? null
           : HrGroupKey.Builder.create(contract.getGroupKey()));
   return builder;
 }
    /**
     * Creates a builder by populating it with data from the given {@link
     * AgendaItemDefinitionContract}.
     *
     * @param contract the contract from which to populate this builder
     * @return an instance of the builder populated with data from the contract
     * @throws IllegalArgumentException if the contract is null
     */
    public static Builder create(AgendaItemDefinitionContract contract) {
      if (contract == null) {
        throw new IllegalArgumentException("contract is null");
      }
      Builder builder = new Builder(contract.getId(), contract.getAgendaId());
      builder.setRuleId(contract.getRuleId());
      builder.setSubAgendaId(contract.getSubAgendaId());
      builder.setWhenTrueId(contract.getWhenTrueId());
      builder.setWhenFalseId(contract.getWhenFalseId());
      builder.setAlwaysId(contract.getAlwaysId());

      if (contract.getRule() != null) {
        builder.setRule(RuleDefinition.Builder.create(contract.getRule()));
      }
      if (contract.getSubAgenda() != null) {
        builder.setSubAgenda(AgendaDefinition.Builder.create(contract.getSubAgenda()));
      }
      if (contract.getWhenTrue() != null) {
        builder.setWhenTrue(AgendaItemDefinition.Builder.create(contract.getWhenTrue()));
      }
      if (contract.getWhenFalse() != null) {
        builder.setWhenFalse(AgendaItemDefinition.Builder.create(contract.getWhenFalse()));
      }
      if (contract.getAlways() != null) {
        builder.setAlways(AgendaItemDefinition.Builder.create(contract.getAlways()));
      }
      builder.setVersionNumber(contract.getVersionNumber());
      return builder;
    }
Example #4
0
 /**
  * Creates a builder by populating it with data from the given {@link ParameterTypeContract}.
  *
  * @param contract the contract from which to populate this builder
  * @return an instance of the builder populated with data from the contract
  */
 public static Builder create(ParameterTypeContract contract) {
   Builder builder = new Builder(contract.getCode());
   builder.setName(contract.getName());
   builder.setActive(contract.isActive());
   builder.setVersionNumber(contract.getVersionNumber());
   builder.setObjectId(contract.getObjectId());
   return builder;
 }
 /**
  * static factory to create a {@link Builder} from a {@link TermParameterDefinitionContract}
  *
  * @param termParameterDefinition
  */
 public static Builder create(TermParameterDefinitionContract termParameterDefinition) {
   Builder builder =
       new Builder(
           termParameterDefinition.getId(),
           termParameterDefinition.getTermId(),
           termParameterDefinition.getName(),
           termParameterDefinition.getValue());
   builder.setVersionNumber(termParameterDefinition.getVersionNumber());
   return builder;
 }
Example #6
0
 /** creates a County Builder from an existing {@link CountyContract}. */
 public static Builder create(CountyContract contract) {
   final Builder builder =
       new Builder(
           contract.getCode(),
           contract.getName(),
           contract.getCountryCode(),
           contract.getStateCode());
   builder.setActive(contract.isActive());
   builder.setVersionNumber(contract.getVersionNumber());
   return builder;
 }
 /** creates a KimTypeAttribute from an existing {@link KimTypeAttributeContract}. */
 public static Builder create(KimTypeAttributeContract contract) {
   Builder builder = new Builder();
   builder.setId(contract.getId());
   builder.setSortCode(contract.getSortCode());
   if (contract.getKimAttribute() != null) {
     builder.setKimAttribute(KimAttribute.Builder.create(contract.getKimAttribute()));
   }
   builder.setKimTypeId(contract.getKimTypeId());
   builder.setActive(contract.isActive());
   builder.setVersionNumber(contract.getVersionNumber());
   builder.setObjectId(contract.getObjectId());
   return builder;
 }
 public static Builder create(ExtensionDefinitionContract contract) {
   if (contract == null) {
     throw new IllegalArgumentException("contract was null");
   }
   Builder builder =
       create(contract.getName(), contract.getType(), contract.getResourceDescriptor());
   builder.setId(contract.getId());
   builder.setApplicationId(contract.getApplicationId());
   builder.setLabel(contract.getLabel());
   builder.setDescription(contract.getDescription());
   builder.setConfiguration(contract.getConfiguration());
   builder.setVersionNumber(contract.getVersionNumber());
   return builder;
 }
 public static Builder create(NotificationRecipientContract contract) {
   if (contract == null) {
     throw new IllegalArgumentException("contract was null");
   }
   // TODO if create() is modified to accept required parameters, this will need to be modified
   Builder builder = create();
   builder.setNotificationId(contract.getNotificationId());
   builder.setRecipientType(contract.getRecipientType());
   builder.setRecipientId(contract.getRecipientId());
   builder.setId(contract.getId());
   builder.setVersionNumber(contract.getVersionNumber());
   builder.setObjectId(contract.getObjectId());
   return builder;
 }
    public static Builder create(OlePatronLoanDocumentsContract contract) {

      if (contract == null) {
        throw new IllegalArgumentException("contract was null");
      }
      Builder builder = create();

      builder.olePatronLoanDocuments = new ArrayList<OlePatronLoanDocument.Builder>();
      if (!CollectionUtils.isEmpty(contract.getOlePatronLoanDocuments())) {
        for (OlePatronLoanDocumentContract olePatronLoanDocumentContract :
            contract.getOlePatronLoanDocuments()) {
          builder.olePatronLoanDocuments.add(
              OlePatronLoanDocument.Builder.create(olePatronLoanDocumentContract));
        }
      }

      builder.setVersionNumber(contract.getVersionNumber());

      // builder.setId(contract.getId());

      return builder;
    }