/** * two objects of type RuleCriterion should be considered equal if their name and type are the same * */ public boolean equals(Object o) { if (this == o) return true; if ((o == null) || (!(o instanceof RuleCriterion))) return false; RuleCriterion r = (RuleCriterion)o; if (this.name != null) { if (!(this.name.equals(r.getName()))) return false; } else if (r.getName() != null) return false; if (this.type != null) { if (!(this.type.equals(r.getType()))) return false; } else if (r.getType() != null) return false; return true; } /* (non-Javadoc)
public ProfileLocatorPropertyImpl(RuleCriterion criterion, boolean isControl, boolean isNavigation, String value) { this.name = criterion.getName(); this.value = value; this.type = criterion.getType(); this.fallbackType = criterion.getFallbackType(); this.isControl = isControl; this.isNavigation = isNavigation; }
@GET @Path("/edit/{id}/") public ProfileEditBean lookupProfile(@Context HttpServletRequest servletRequest, @Context UriInfo uriInfo, @PathParam("id") String profileId) { checkPrivilege(servletRequest, JetspeedActions.VIEW); if (StringUtils.isBlank(profileId)) { throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).entity( new UpdateResultBean(Response.Status.BAD_REQUEST.getStatusCode(), "Profile id not specified")).build()); } ProfilingRule rule = profiler.getRule(profileId); if (rule == null) { throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).entity( new UpdateResultBean(Response.Status.BAD_REQUEST.getStatusCode(), "Profile id not found with the specified id: " + profileId)).build()); } ProfileEditBean editBean = new ProfileEditBean(rule.getId(), rule.getTitle(), rule.getClassname()); for (RuleCriterion criterion : rule.getRuleCriteria()) { editBean.add(new ProfileCriterionBean(criterion.getName(), criterion.getValue(), criterion.getType(), criterion.getFallbackType(), criterion.getFallbackOrder())); } return editBean; }
public JSRuleCriterion(RuleCriterion c) { this.name = c.getName(); this.type = c.getType(); this.value = c.getValue(); this.fallBackOrder = c.getFallbackOrder(); this.fallBackType = c.getFallbackType(); }
public RuleCriterionImpl(RuleCriterion master) { this.name = master.getName(); this.ruleId = master.getRuleId(); this.type = master.getType(); this.value = master.getValue(); this.fallbackOrder = master.getFallbackOrder(); this.fallbackType = master.getFallbackType(); } /**