-
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 #285 from fayranne/feature/bhOneEntities
Feature/bh one entities
- Loading branch information
Showing
36 changed files
with
3,363 additions
and
1 deletion.
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
61 changes: 61 additions & 0 deletions
61
...ava/com/bullhornsdk/data/model/entity/association/paybill/BillingProfileAssociations.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,61 @@ | ||
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.BillingProfile; | ||
import com.bullhornsdk.data.model.entity.core.paybill.BillingProfileVersion; | ||
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 BillingProfileAssociations implements EntityAssociations<BillingProfile> { | ||
|
||
private List<AssociationField<BillingProfile, ? extends BullhornEntity>> allAssociations; | ||
private final AssociationField<BillingProfile, BillingProfileVersion> versions = instantiateAssociationField("versions", BillingProfileVersion.class); | ||
|
||
private static final BillingProfileAssociations INSTANCE = new BillingProfileAssociations(); | ||
|
||
private BillingProfileAssociations() { | ||
super(); | ||
} | ||
|
||
public static BillingProfileAssociations getInstance() { | ||
return INSTANCE; | ||
} | ||
|
||
public AssociationField<BillingProfile, BillingProfileVersion> versions() { | ||
return versions; | ||
} | ||
|
||
private <E extends BullhornEntity> AssociationField<BillingProfile, E> instantiateAssociationField(String associationName, Class<E> associationType) { | ||
return new StandardAssociationField<BillingProfile, E>(associationName, associationType); | ||
} | ||
|
||
@Override | ||
public List<AssociationField<BillingProfile, ? extends BullhornEntity>> allAssociations() { | ||
if (allAssociations == null) { | ||
allAssociations = new ArrayList<AssociationField<BillingProfile, ? extends BullhornEntity>>(); | ||
allAssociations.add(versions()); | ||
|
||
} | ||
return allAssociations; | ||
} | ||
|
||
@Override | ||
public AssociationField<BillingProfile, ? extends BullhornEntity> getAssociation(String associationName) { | ||
for (AssociationField<BillingProfile, ? extends BullhornEntity> associationField : allAssociations()) { | ||
if (associationName.equalsIgnoreCase(associationField.getAssociationFieldName())) { | ||
return associationField; | ||
} | ||
} | ||
|
||
throw new IllegalArgumentException("There is no association on entity BillingProfile called: " + associationName); | ||
} | ||
} | ||
|
||
|
61 changes: 61 additions & 0 deletions
61
...n/java/com/bullhornsdk/data/model/entity/association/paybill/InvoiceTermAssociations.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,61 @@ | ||
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.invoice.InvoiceTerm; | ||
import com.bullhornsdk.data.model.entity.core.paybill.invoice.InvoiceTermVersion; | ||
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 InvoiceTermAssociations implements EntityAssociations<InvoiceTerm> { | ||
|
||
private List<AssociationField<InvoiceTerm, ? extends BullhornEntity>> allAssociations; | ||
private final AssociationField<InvoiceTerm, InvoiceTermVersion> versions = instantiateAssociationField("versions", InvoiceTermVersion.class); | ||
|
||
private static final InvoiceTermAssociations INSTANCE = new InvoiceTermAssociations(); | ||
|
||
private InvoiceTermAssociations() { | ||
super(); | ||
} | ||
|
||
public static InvoiceTermAssociations getInstance() { | ||
return INSTANCE; | ||
} | ||
|
||
public AssociationField<InvoiceTerm, InvoiceTermVersion> versions() { | ||
return versions; | ||
} | ||
|
||
private <E extends BullhornEntity> AssociationField<InvoiceTerm, E> instantiateAssociationField(String associationName, Class<E> associationType) { | ||
return new StandardAssociationField<InvoiceTerm, E>(associationName, associationType); | ||
} | ||
|
||
@Override | ||
public List<AssociationField<InvoiceTerm, ? extends BullhornEntity>> allAssociations() { | ||
if (allAssociations == null) { | ||
allAssociations = new ArrayList<AssociationField<InvoiceTerm, ? extends BullhornEntity>>(); | ||
allAssociations.add(versions()); | ||
|
||
} | ||
return allAssociations; | ||
} | ||
|
||
@Override | ||
public AssociationField<InvoiceTerm, ? extends BullhornEntity> getAssociation(String associationName) { | ||
for (AssociationField<InvoiceTerm, ? extends BullhornEntity> associationField : allAssociations()) { | ||
if (associationName.equalsIgnoreCase(associationField.getAssociationFieldName())) { | ||
return associationField; | ||
} | ||
} | ||
|
||
throw new IllegalArgumentException("There is no association on entity InvoiceTerm called: " + associationName); | ||
} | ||
} | ||
|
||
|
61 changes: 61 additions & 0 deletions
61
...main/java/com/bullhornsdk/data/model/entity/association/paybill/LocationAssociations.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,61 @@ | ||
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.Location; | ||
import com.bullhornsdk.data.model.entity.core.paybill.LocationVersion; | ||
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 LocationAssociations implements EntityAssociations<Location> { | ||
|
||
private List<AssociationField<Location, ? extends BullhornEntity>> allAssociations; | ||
private final AssociationField<Location, LocationVersion> versions = instantiateAssociationField("versions", LocationVersion.class); | ||
|
||
private static final LocationAssociations INSTANCE = new LocationAssociations(); | ||
|
||
private LocationAssociations() { | ||
super(); | ||
} | ||
|
||
public static LocationAssociations getInstance() { | ||
return INSTANCE; | ||
} | ||
|
||
public AssociationField<Location, LocationVersion> versions() { | ||
return versions; | ||
} | ||
|
||
private <E extends BullhornEntity> AssociationField<Location, E> instantiateAssociationField(String associationName, Class<E> associationType) { | ||
return new StandardAssociationField<Location, E>(associationName, associationType); | ||
} | ||
|
||
@Override | ||
public List<AssociationField<Location, ? extends BullhornEntity>> allAssociations() { | ||
if (allAssociations == null) { | ||
allAssociations = new ArrayList<AssociationField<Location, ? extends BullhornEntity>>(); | ||
allAssociations.add(versions()); | ||
|
||
} | ||
return allAssociations; | ||
} | ||
|
||
@Override | ||
public AssociationField<Location, ? extends BullhornEntity> getAssociation(String associationName) { | ||
for (AssociationField<Location, ? extends BullhornEntity> associationField : allAssociations()) { | ||
if (associationName.equalsIgnoreCase(associationField.getAssociationFieldName())) { | ||
return associationField; | ||
} | ||
} | ||
|
||
throw new IllegalArgumentException("There is no association on entity Location called: " + associationName); | ||
} | ||
} | ||
|
||
|
Oops, something went wrong.