-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #379 from bullhorn/f/unbilled-revenue-distribution…
…-associations unbilled revenue distribution association and invoice statement property
- Loading branch information
Showing
7 changed files
with
130 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
...ornsdk/data/model/entity/association/paybill/UnbilledRevenueDistributionAssociations.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package com.bullhornsdk.data.model.entity.association.paybill; | ||
|
||
import com.bullhornsdk.data.model.entity.association.AssociationField; | ||
import com.bullhornsdk.data.model.entity.association.EntityAssociations; | ||
import com.bullhornsdk.data.model.entity.association.standard.StandardAssociationField; | ||
import com.bullhornsdk.data.model.entity.core.paybill.distribution.UnbilledRevenueDistribution; | ||
import com.bullhornsdk.data.model.entity.core.paybill.invoice.InvoiceTerm; | ||
import com.bullhornsdk.data.model.entity.core.paybill.invoice.InvoiceTermVersion; | ||
import com.bullhornsdk.data.model.entity.core.paybill.transaction.BillMasterTransaction; | ||
import com.bullhornsdk.data.model.entity.core.standard.CorporateUser; | ||
import com.bullhornsdk.data.model.entity.core.standard.JobOrder; | ||
import com.bullhornsdk.data.model.entity.core.type.BullhornEntity; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Created by fayranne.lipton 4/10/2020 | ||
*/ | ||
public class UnbilledRevenueDistributionAssociations implements EntityAssociations<UnbilledRevenueDistribution> { | ||
|
||
private final AssociationField<UnbilledRevenueDistribution, BillMasterTransaction> billMasterTransactions = instantiateAssociationField("billMasterTransactions", BillMasterTransaction.class); | ||
private List<AssociationField<UnbilledRevenueDistribution, ? extends BullhornEntity>> allAssociations; | ||
|
||
private static final UnbilledRevenueDistributionAssociations INSTANCE = new UnbilledRevenueDistributionAssociations(); | ||
|
||
private UnbilledRevenueDistributionAssociations() { | ||
super(); | ||
} | ||
|
||
public static UnbilledRevenueDistributionAssociations getInstance() { | ||
return INSTANCE; | ||
} | ||
|
||
public AssociationField<UnbilledRevenueDistribution, BillMasterTransaction> billMasterTransactions() { | ||
return billMasterTransactions; | ||
} | ||
|
||
private <E extends BullhornEntity> AssociationField<UnbilledRevenueDistribution, E> instantiateAssociationField(String associationName, Class<E> associationType) { | ||
return new StandardAssociationField<UnbilledRevenueDistribution, E>(associationName, associationType); | ||
} | ||
|
||
@Override | ||
public List<AssociationField<UnbilledRevenueDistribution, ? extends BullhornEntity>> allAssociations() { | ||
if (allAssociations == null) { | ||
allAssociations = new ArrayList<AssociationField<UnbilledRevenueDistribution, ? extends BullhornEntity>>(); | ||
allAssociations.add(billMasterTransactions()); | ||
} | ||
return allAssociations; | ||
} | ||
|
||
@Override | ||
public AssociationField<UnbilledRevenueDistribution, ? extends BullhornEntity> getAssociation(String associationName) { | ||
for (AssociationField<UnbilledRevenueDistribution, ? extends BullhornEntity> associationField : allAssociations()) { | ||
if (associationName.equalsIgnoreCase(associationField.getAssociationFieldName())) { | ||
return associationField; | ||
} | ||
} | ||
|
||
throw new IllegalArgumentException("There is no association on entity UnbilledRevenueDistribution called: " + associationName); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters