コード例 #1
0
 @Override
 public boolean equals(Object obj) {
   if (this == obj) {
     return true;
   }
   if (obj == null) {
     return false;
   }
   if (getClass() != obj.getClass()) {
     return false;
   }
   ForexOptionDigitalDefinition other = (ForexOptionDigitalDefinition) obj;
   if (!ObjectUtils.equals(_expirationDate, other._expirationDate)) {
     return false;
   }
   if (_isCall != other._isCall) {
     return false;
   }
   if (_isLong != other._isLong) {
     return false;
   }
   if (_payDomestic != other._payDomestic) {
     return false;
   }
   if (!ObjectUtils.equals(_underlyingForex, other._underlyingForex)) {
     return false;
   }
   return true;
 }
コード例 #2
0
  /**
   * @param documentId
   * @param result
   * @return
   */
  @RequestMapping(method = {RequestMethod.GET, RequestMethod.POST})
  public ModelAndView processSubmit(
      @ModelAttribute("command") ShowSameFolioDocumentsCommand command,
      BindingResult result,
      HttpSession session) {
    Map<String, Object> model = new HashMap<String, Object>(0);

    List<String> outputFields = new ArrayList<String>(6);
    outputFields.add("Sender");
    outputFields.add("Recipient");
    outputFields.add("Date");
    outputFields.add("Sender Location");
    outputFields.add("Recipient Location");
    outputFields.add("Volume / Insert / Folio");

    model.put("outputFields", outputFields);
    model.put("volNum", command.getVolNum());
    model.put("volLetExt", ObjectUtils.toString(command.getVolLetExt()));
    model.put("insertNum", ObjectUtils.toString(command.getInsertNum()));
    model.put("insertLet", ObjectUtils.toString(command.getInsertLet()));
    model.put("folioNum", command.getFolioNum());
    model.put("folioMod", ObjectUtils.toString(command.getFolioMod()));
    model.put("folioRectoVerso", ObjectUtils.toString(command.getFolioRectoVerso()));

    return new ModelAndView("docbase/ShowSameFolioDocuments", model);
  }
コード例 #3
0
 private void createOrupdateConfigObject(
     Date date, String componentName, ConfigKey<?> key, String value) {
   ConfigurationVO vo = _configDao.findById(key.key());
   if (vo == null) {
     vo = new ConfigurationVO(componentName, key);
     vo.setUpdated(date);
     if (value != null) {
       vo.setValue(value);
     }
     _configDao.persist(vo);
   } else {
     if (vo.isDynamic() != key.isDynamic()
         || !ObjectUtils.equals(vo.getDescription(), key.description())
         || !ObjectUtils.equals(vo.getDefaultValue(), key.defaultValue())
         || !ObjectUtils.equals(vo.getScope(), key.scope().toString())
         || !ObjectUtils.equals(vo.getComponent(), componentName)) {
       vo.setDynamic(key.isDynamic());
       vo.setDescription(key.description());
       vo.setDefaultValue(key.defaultValue());
       vo.setScope(key.scope().toString());
       vo.setComponent(componentName);
       vo.setUpdated(date);
       _configDao.persist(vo);
     }
   }
 }
コード例 #4
0
 @Override
 public boolean equals(final Object obj) {
   if (this == obj) {
     return true;
   }
   if (!(obj instanceof EquityIndexFutureOptionDefinition)) {
     return false;
   }
   final EquityIndexFutureOptionDefinition other = (EquityIndexFutureOptionDefinition) obj;
   if (_exerciseType != other._exerciseType) {
     return false;
   }
   if (_isCall != other._isCall) {
     return false;
   }
   if (Double.compare(_strike, other._strike) != 0) {
     return false;
   }
   if (Double.compare(_pointValue, other._pointValue) != 0) {
     return false;
   }
   if (!ObjectUtils.equals(_expiryDate, other._expiryDate)) {
     return false;
   }
   if (!ObjectUtils.equals(_underlying, other._underlying)) {
     return false;
   }
   return true;
 }
コード例 #5
0
 public boolean sameObject(DocFormRequestKey other) {
   return (this.classRef != null)
       && (this.objNb != null)
       && (this.objNb >= 0)
       && ObjectUtils.equals(this.classRef, other.classRef)
       && ObjectUtils.equals(this.objNb, other.objNb);
 }
コード例 #6
0
 private CharacteristicDto restoreCharacteristic(
     DebtCharacteristic targetCharacteristic,
     @Nullable Integer parentId,
     List<CharacteristicDto> sourceCharacteristics,
     Date updateDate,
     DbSession session) {
   CharacteristicDto sourceCharacteristic =
       characteristicByKey(targetCharacteristic.key(), sourceCharacteristics, false);
   if (sourceCharacteristic == null) {
     CharacteristicDto newCharacteristic =
         toDto(targetCharacteristic, parentId).setCreatedAt(updateDate);
     dbClient.debtCharacteristicDao().insert(newCharacteristic, session);
     return newCharacteristic;
   } else {
     // Update only if modifications
     if (ObjectUtils.notEqual(sourceCharacteristic.getName(), targetCharacteristic.name())
         || ObjectUtils.notEqual(sourceCharacteristic.getOrder(), targetCharacteristic.order())
         || ObjectUtils.notEqual(sourceCharacteristic.getParentId(), parentId)) {
       sourceCharacteristic.setName(targetCharacteristic.name());
       sourceCharacteristic.setOrder(targetCharacteristic.order());
       sourceCharacteristic.setParentId(parentId);
       sourceCharacteristic.setUpdatedAt(updateDate);
       dbClient.debtCharacteristicDao().update(sourceCharacteristic, session);
     }
     return sourceCharacteristic;
   }
 }
コード例 #7
0
  private void addRoutes(Object handler) {
    Class clazz = handler.getClass();
    for (Method method : clazz.getMethods()) {
      int modifier = method.getModifiers();
      if (!(Modifier.isPublic(modifier))) continue;

      Class<?>[] paramTypes = method.getParameterTypes();
      if (paramTypes.length != 2
          || !paramTypes[0].equals(Request.class)
          || !paramTypes[1].equals(Response.class)) continue;

      Before beforeAnn = method.getAnnotation(Before.class);
      After afterAnn = method.getAnnotation(After.class);
      Route routeAnn = method.getAnnotation(Route.class);

      if (routeAnn != null) routes.add(new MatchEntity(handler, method, routeAnn));
      else if (beforeAnn != null) before.add(new MatchEntity(handler, method, beforeAnn));
      else if (afterAnn != null) after.add(new MatchEntity(handler, method, afterAnn));
    }

    if (L.isInfoEnabled()) {
      for (MatchEntity e : routes) L.info(null, "route " + ObjectUtils.toString(e));
      for (MatchEntity e : before) L.info(null, "before " + ObjectUtils.toString(e));
      for (MatchEntity e : after) L.info(null, "after " + ObjectUtils.toString(e));
    }
  }
コード例 #8
0
 /**
  * Checks for an existing route that matches the {@link er.rest.routes.ERXRoute.Method} and {@link
  * er.rest.routes.ERXRoute#routePattern()} of <code>route</code> and yet has a different
  * controller or action mapping.
  *
  * @param route
  */
 protected void verifyRoute(ERXRoute route) {
   ERXRoute duplicateRoute =
       routeForMethodAndPattern(route.method(), route.routePattern().pattern());
   if (duplicateRoute != null) {
     boolean isDifferentController =
         ObjectUtils.notEqual(duplicateRoute.controller(), route.controller());
     boolean isDifferentAction = ObjectUtils.notEqual(duplicateRoute.action(), route.action());
     if (isDifferentController || isDifferentAction) {
       // We have a problem whereby two routes with same url pattern and http method map to
       // different direct actions
       StringBuilder message = new StringBuilder();
       message.append("The route <");
       message.append(route);
       message.append("> conflicts with existing route <");
       message.append(duplicateRoute);
       message.append(">.");
       if (isDifferentController) {
         message.append(" The controller class <");
         message.append(route.controller());
         message.append("> is different to <");
         message.append(duplicateRoute.controller());
         message.append(">.");
       }
       if (isDifferentAction) {
         message.append(" The action <");
         message.append(route.action());
         message.append("> is different to <");
         message.append(duplicateRoute.action());
         message.append(">.");
       }
       throw new IllegalStateException(message.toString());
     }
   }
 }
コード例 #9
0
 @Override
 public boolean equals(final Object obj) {
   if (this == obj) {
     return true;
   }
   if (obj == null) {
     return false;
   }
   if (getClass() != obj.getClass()) {
     return false;
   }
   final EquityFutureDefinition other = (EquityFutureDefinition) obj;
   if (Double.doubleToLongBits(_strikePrice) != Double.doubleToLongBits(other._strikePrice)) {
     return false;
   }
   if (!ObjectUtils.equals(_expiryDate, other._expiryDate)) {
     return false;
   }
   if (!ObjectUtils.equals(_settlementDate, other._settlementDate)) {
     return false;
   }
   if (!ObjectUtils.equals(_currency, other._currency)) {
     return false;
   }
   if (Double.doubleToLongBits(_unitAmount) != Double.doubleToLongBits(other._unitAmount)) {
     return false;
   }
   return true;
 }
コード例 #10
0
 @Override
 public boolean equals(final Object obj) {
   if (this == obj) {
     return true;
   }
   if (!super.equals(obj)) {
     return false;
   }
   if (getClass() != obj.getClass()) {
     return false;
   }
   final CouponONSimplifiedDefinition other = (CouponONSimplifiedDefinition) obj;
   if (!ObjectUtils.equals(_fixingPeriodEndDate, other._fixingPeriodEndDate)) {
     return false;
   }
   if (!ObjectUtils.equals(_fixingPeriodStartDate, other._fixingPeriodStartDate)) {
     return false;
   }
   if (Double.doubleToLongBits(_fixingPeriodAccrualFactor)
       != Double.doubleToLongBits(other._fixingPeriodAccrualFactor)) {
     return false;
   }
   if (!ObjectUtils.equals(_index, other._index)) {
     return false;
   }
   return true;
 }
コード例 #11
0
ファイル: Provider.java プロジェクト: llavoie/simple-emr
 @Override
 public int hashCode() {
   int hash = 1;
   hash = hash * 31 + ObjectUtils.hashCode(person);
   hash = hash * 31 + ObjectUtils.hashCode(type);
   return hash;
 }
コード例 #12
0
 @Override
 public boolean equals(Object obj) {
   if (this == obj) {
     return true;
   }
   if (obj == null) {
     return false;
   }
   if (getClass() != obj.getClass()) {
     return false;
   }
   GeneratorSwapFixedIbor other = (GeneratorSwapFixedIbor) obj;
   if (!ObjectUtils.equals(_businessDayConvention, other._businessDayConvention)) {
     return false;
   }
   if (_endOfMonth != other._endOfMonth) {
     return false;
   }
   if (!ObjectUtils.equals(_fixedLegDayCount, other._fixedLegDayCount)) {
     return false;
   }
   if (!ObjectUtils.equals(_fixedLegPeriod, other._fixedLegPeriod)) {
     return false;
   }
   if (!ObjectUtils.equals(_iborIndex, other._iborIndex)) {
     return false;
   }
   if (_spotLag != other._spotLag) {
     return false;
   }
   return true;
 }
コード例 #13
0
 @Override
 public boolean equals(final Object obj) {
   if (this == obj) {
     return true;
   }
   if (!super.equals(obj)) {
     return false;
   }
   if (getClass() != obj.getClass()) {
     return false;
   }
   final BondCapitalIndexedSecurity<?> other = (BondCapitalIndexedSecurity<?>) obj;
   if (Double.doubleToLongBits(_accruedInterest)
       != Double.doubleToLongBits(other._accruedInterest)) {
     return false;
   }
   if (_couponPerYear != other._couponPerYear) {
     return false;
   }
   if (Double.doubleToLongBits(_factorToNextCoupon)
       != Double.doubleToLongBits(other._factorToNextCoupon)) {
     return false;
   }
   if (Double.doubleToLongBits(_indexStartValue)
       != Double.doubleToLongBits(other._indexStartValue)) {
     return false;
   }
   if (!ObjectUtils.equals(_settlement, other._settlement)) {
     return false;
   }
   if (!ObjectUtils.equals(_yieldConvention, other._yieldConvention)) {
     return false;
   }
   return true;
 }
 @Override
 public boolean equals(final Object obj) {
   if (this == obj) {
     return true;
   }
   if (obj == null) {
     return false;
   }
   if (getClass() != obj.getClass()) {
     return false;
   }
   final SwapFuturesPriceDeliverableSecurityDefinition other =
       (SwapFuturesPriceDeliverableSecurityDefinition) obj;
   if (!ObjectUtils.equals(_deliveryDate, other._deliveryDate)) {
     return false;
   }
   if (!ObjectUtils.equals(_lastTradingDate, other._lastTradingDate)) {
     return false;
   }
   if (Double.doubleToLongBits(_notional) != Double.doubleToLongBits(other._notional)) {
     return false;
   }
   if (!ObjectUtils.equals(_underlyingSwap, other._underlyingSwap)) {
     return false;
   }
   return true;
 }
コード例 #15
0
 @Override
 public void deserialize(JsonNode jn) {
   setType(ObjectUtils.toString(jn.path(COL_TYPE).getTextValue(), ""));
   setInfo(ObjectUtils.toString(jn.path(COL_INFO).getTextValue(), ""));
   setPrimary(jn.path(COL_PRIMARY).getValueAsBoolean(false));
   setBinding(jn.path(COL_BINDING).getValueAsBoolean(false));
   setLabel(ObjectUtils.toString(jn.path(COL_LABEL).getTextValue(), ""));
 }
コード例 #16
0
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ObjectUtils.hashCode(_name);
   result = prime * result + ObjectUtils.hashCode(_alias);
   return result;
 }
コード例 #17
0
ファイル: Address.java プロジェクト: indvd00m/jpacontainer
 @Override
 public int hashCode() {
   int hash = 7;
   hash = hash * 31 + ObjectUtils.hashCode(streetOrBox);
   hash = hash * 31 + ObjectUtils.hashCode(postalCode);
   hash = hash * 31 + ObjectUtils.hashCode(postOffice);
   hash = hash * 31 + ObjectUtils.hashCode(country);
   return hash;
 }
コード例 #18
0
 /** {@inheritDoc} */
 @Override
 public int hashCode() {
   int hashCode = super.hashCode();
   hashCode += ObjectUtils.hashCode(propertyGroups);
   hashCode += ObjectUtils.hashCode(templateType);
   hashCode += ObjectUtils.hashCode(inputs);
   hashCode += ObjectUtils.hashCode(outputs);
   return hashCode;
 }
コード例 #19
0
  @Override
  public void writeExternal(Element element) throws WriteExternalException {
    super.writeExternal(element);

    element.setAttribute(
        "ceylon-module", (String) ObjectUtils.defaultIfNull(getCeylonModule(), ""));
    element.setAttribute(
        "top-level", (String) ObjectUtils.defaultIfNull(getTopLevelNameFull(), ""));
  }
コード例 #20
0
ファイル: KSMetaData.java プロジェクト: rcamus/platform
 public boolean equals(Object obj) {
   if (!(obj instanceof KSMetaData)) return false;
   KSMetaData other = (KSMetaData) obj;
   return other.name.equals(name)
       && ObjectUtils.equals(other.strategyClass, strategyClass)
       && ObjectUtils.equals(other.strategyOptions, strategyOptions)
       && other.cfMetaData.equals(cfMetaData)
       && other.durableWrites == durableWrites;
 }
コード例 #21
0
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ObjectUtils.hashCode(_objectId);
   result = prime * result + ObjectUtils.hashCode(_objectClass);
   result = prime * result + ObjectUtils.hashCode(_storeAttributes);
   return result;
 }
コード例 #22
0
 @Override
 public int hashCode() {
   return ObjectUtils.hashCode(mUsername)
       + Arrays.hashCode(mPassword)
       + Arrays.hashCode(contextClasses)
       + ObjectUtils.hashCode(mHostname)
       + ObjectUtils.hashCode(mPort)
       + ObjectUtils.hashCode(mURL);
 }
コード例 #23
0
 @Override
 public boolean equals(final Object o) {
   if (o instanceof GroupTaskAccessDO) {
     final GroupTaskAccessDO other = (GroupTaskAccessDO) o;
     if (ObjectUtils.equals(this.getGroupId(), other.getGroupId()) == false) return false;
     if (ObjectUtils.equals(this.getTaskId(), other.getTaskId()) == false) return false;
     return true;
   }
   return false;
 }
コード例 #24
0
ファイル: UserOpenIDLink.java プロジェクト: KengoTODA/partake
  @Override
  public int hashCode() {
    int code = 0;

    code = code * 37 + ObjectUtils.hashCode(id);
    code = code * 37 + ObjectUtils.hashCode(userId);
    code = code * 37 + ObjectUtils.hashCode(identifier);

    return code;
  }
コード例 #25
0
 public boolean matches(Object o) {
   if (!(o instanceof Measure)) {
     return false;
   }
   Measure m = (Measure) o;
   return ObjectUtils.equals(metric, m.getMetric())
       && ObjectUtils.equals(var1, m.getVariation1())
       && ObjectUtils.equals(var2, m.getVariation2())
       && !(m instanceof RuleMeasure);
 }
コード例 #26
0
  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    TypedInfo other = (TypedInfo) o;
    return ObjectUtils.equals(type, other.type)
        && ObjectUtils.equals(info, other.info)
        && ObjectUtils.equals(flag, other.flag)
        && ObjectUtils.equals(label, other.label);
  }
コード例 #27
0
ファイル: BaseTPRole.java プロジェクト: trackplus/Genji
  /**
   * Set the value of ProjectType
   *
   * @param v new value
   */
  public void setProjectType(Integer v) throws TorqueException {

    if (!ObjectUtils.equals(this.projectType, v)) {
      this.projectType = v;
      setModified(true);
    }

    if (aTProjectType != null && !ObjectUtils.equals(aTProjectType.getObjectID(), v)) {
      aTProjectType = null;
    }
  }
コード例 #28
0
ファイル: BaseTPRole.java プロジェクト: trackplus/Genji
  /**
   * Set the value of Role
   *
   * @param v new value
   */
  public void setRole(Integer v) throws TorqueException {

    if (!ObjectUtils.equals(this.role, v)) {
      this.role = v;
      setModified(true);
    }

    if (aTRole != null && !ObjectUtils.equals(aTRole.getObjectID(), v)) {
      aTRole = null;
    }
  }
コード例 #29
0
ファイル: IssuesModeTest.java プロジェクト: kirisky/sonarqube
  // SONAR-6522
  @Test
  public void load_user_name_in_json_report() throws Exception {
    restoreProfile("one-issue-per-line.xml");
    orchestrator.getServer().provisionProject("sample", "xoo-sample");
    orchestrator
        .getServer()
        .associateProjectToQualityProfile("sample", "xoo", "one-issue-per-line");

    // First run (publish mode)
    SonarRunner runner = configureRunner("shared/xoo-sample");
    orchestrator.executeBuild(runner);

    SonarClient client = orchestrator.getServer().adminWsClient();

    Issues issues = client.issueClient().find(IssueQuery.create());
    Issue issue = issues.list().get(0);

    UserParameters creationParameters =
        UserParameters.create()
            .login("julien")
            .name("Julien H")
            .password("password")
            .passwordConfirmation("password");
    client.userClient().create(creationParameters);

    // Assign issue
    client.issueClient().assign(issue.key(), "julien");

    // Issues
    runner = configureRunnerIssues("shared/xoo-sample");
    BuildResult result = orchestrator.executeBuild(runner);

    JSONObject obj = ItUtils.getJSONReport(result);

    Map<String, String> userNameByLogin = Maps.newHashMap();
    final JSONArray users = (JSONArray) obj.get("users");
    if (users != null) {
      for (Object user : users) {
        String login = ObjectUtils.toString(((JSONObject) user).get("login"));
        String name = ObjectUtils.toString(((JSONObject) user).get("name"));
        userNameByLogin.put(login, name);
      }
    }
    assertThat(userNameByLogin.get("julien")).isEqualTo("Julien H");

    for (Object issueJson : (JSONArray) obj.get("issues")) {
      JSONObject jsonObject = (JSONObject) issueJson;
      if (issue.key().equals(jsonObject.get("key"))) {
        assertThat(jsonObject.get("assignee")).isEqualTo("julien");
        return;
      }
    }
    fail("Issue not found");
  }
コード例 #30
0
  @Override
  public boolean equals(Object obj) {
    if (!(obj instanceof RepeatingSchedulableJob)) {
      return false;
    }
    RepeatingSchedulableJob job = (RepeatingSchedulableJob) obj;

    return ObjectUtils.equals(repeatCount, job.repeatCount)
        && ObjectUtils.equals(repeatIntervalInSeconds, job.repeatIntervalInSeconds)
        && super.equals(job);
  }