public GenericValue convertToGenericValue(ProjectComponent projectComponent) { if (projectComponent == null) { return null; } return projectComponent.getGenericValue(); }
@Override public void setComponent(Collection<ProjectComponent> components) { if (components == null) { components = Collections.emptyList(); } final List<GenericValue> gvList = new ArrayList<GenericValue>(components.size()); for (ProjectComponent component : components) { gvList.add(component.getGenericValue()); } this.components = components; }
/** * Temporary method to allow conversion of a collection of ProjectComponent objects * to a collection of GenericValues representing a project component. * * @param projectComponents a collection of project components * @return Collection of GenericValues representing the collection of ProjectComponent objects passed in */ public Collection<GenericValue> convertToGenericValues(Collection<ProjectComponent> projectComponents) { final Collection<GenericValue> projectComponentGVs = new ArrayList<GenericValue>(projectComponents.size()); for (ProjectComponent projectComponent : projectComponents) { projectComponentGVs.add(projectComponent.getGenericValue()); } return projectComponentGVs; }
private boolean isAssigneeTypeValid(ProjectComponent component, Long assigneeType) { return ComponentAssigneeTypes.isAssigneeTypeValid(component.getGenericValue(), assigneeType); }
/** * Copy given component * * @param c component to copy * @return new instance of MutableProjectComponent set with values of the given component */ public static MutableProjectComponent copy(final ProjectComponent c) { MutableProjectComponent mutableProjectComponent = new MutableProjectComponent(c.getId(), c.getName(), c.getDescription(), c.getLead(), c.getAssigneeType(), c.getProjectId()); mutableProjectComponent.setGenericValue(c.getGenericValue()); return mutableProjectComponent; }
long realAssigneeType = ComponentUtils.getAssigneeType(component.getGenericValue(), component.getAssigneeType()); String realAssigneeName = null; switch ((int) realAssigneeType) bean.isAssigneeTypeValid = ComponentAssigneeTypes.isAssigneeTypeValid(component.getGenericValue(), AssigneeType.UNASSIGNED.getId());