-
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 branch 'master' into log4j-upgrade
- Loading branch information
Showing
42 changed files
with
4,926 additions
and
4 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
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
55 changes: 55 additions & 0 deletions
55
...com/bullhornsdk/data/model/entity/association/standard/PlacementShiftSetAssociations.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,55 @@ | ||
package com.bullhornsdk.data.model.entity.association.standard; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import com.bullhornsdk.data.model.entity.association.AssociationField; | ||
import com.bullhornsdk.data.model.entity.association.EntityAssociations; | ||
import com.bullhornsdk.data.model.entity.core.standard.PlacementShiftSet; | ||
import com.bullhornsdk.data.model.entity.core.standard.PlacementShiftSetVersion; | ||
import com.bullhornsdk.data.model.entity.core.type.BullhornEntity; | ||
|
||
public class PlacementShiftSetAssociations implements EntityAssociations<PlacementShiftSet> { | ||
|
||
private List<AssociationField<PlacementShiftSet, ? extends BullhornEntity>> allAssociations; | ||
private final AssociationField<PlacementShiftSet, PlacementShiftSetVersion> versions = instantiateAssociationField("versions", PlacementShiftSetVersion.class); | ||
|
||
private static final PlacementShiftSetAssociations INSTANCE = new PlacementShiftSetAssociations(); | ||
|
||
private PlacementShiftSetAssociations() { | ||
super(); | ||
} | ||
|
||
public static PlacementShiftSetAssociations getInstance() { | ||
return INSTANCE; | ||
} | ||
|
||
public AssociationField<PlacementShiftSet, PlacementShiftSetVersion> versions() { | ||
return versions; | ||
} | ||
|
||
|
||
private <E extends BullhornEntity> AssociationField<PlacementShiftSet, E> instantiateAssociationField(String associationName, Class<E> associationType) { | ||
return new StandardAssociationField<PlacementShiftSet, E>(associationName, associationType); | ||
} | ||
|
||
@Override | ||
public List<AssociationField<PlacementShiftSet, ? extends BullhornEntity>> allAssociations() { | ||
if (allAssociations == null) { | ||
allAssociations = new ArrayList<AssociationField<PlacementShiftSet, ? extends BullhornEntity>>(); | ||
allAssociations.add(versions()); | ||
} | ||
return allAssociations; | ||
} | ||
|
||
@Override | ||
public AssociationField<PlacementShiftSet, ? extends BullhornEntity> getAssociation(String associationName) { | ||
for (AssociationField<PlacementShiftSet, ? extends BullhornEntity> associationField : allAssociations()) { | ||
if (associationName.equalsIgnoreCase(associationField.getAssociationFieldName())) { | ||
return associationField; | ||
} | ||
} | ||
|
||
throw new IllegalArgumentException("There is no association on entity PlacementShiftSet called: " + associationName); | ||
} | ||
} |
Oops, something went wrong.