Java Code Examples for org.apache.commons.lang.builder.HashCodeBuilder

The following are top voted examples for showing how to use org.apache.commons.lang.builder.HashCodeBuilder. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: VASSAL-src   File: SourceOpDiskCacheBitmapImpl.java   View source code 6 votes vote down vote up
public SourceOpDiskCacheBitmapImpl(
  String name,
  int tileX,
  int tileY,
  double scale,
  ImageTileSource tileSrc)
{
  if (name == null) throw new IllegalArgumentException();
  if (name.length() == 0) throw new IllegalArgumentException();
  if (tileX < 0) throw new IllegalArgumentException();
  if (tileY < 0) throw new IllegalArgumentException();
  if (scale <= 0) throw new IllegalArgumentException();
  if (tileSrc == null) throw new IllegalArgumentException();

  this.name = name;
  this.tileX = tileX;
  this.tileY = tileY;
  this.scale = scale;
  this.tileSrc = tileSrc;

  hash = new HashCodeBuilder().append(name)
                              .append(tileX)
                              .append(tileY)
                              .append(scale)
                              .toHashCode();
}
 
Example 2
Project: VASSAL-src   File: ScaleOpBitmapImpl.java   View source code 6 votes vote down vote up
/**
 * Constructs an <code>ImageOp</code> which will scale
 * the image produced by its source <code>ImageOp</code>.
 *
 * @param sop the source operation
 * @param scale the scale factor
 * @param hints rendering hints
 */
public ScaleOpBitmapImpl(ImageOp sop, double scale, RenderingHints hints) {
  if (sop == null)
    throw new IllegalArgumentException("Attempt to scale null image");
  if (scale <= 0)
    throw new IllegalArgumentException("Cannot scale image at " + scale);

  this.sop = sop;
  this.scale = scale;
  this.hints = hints;

  hash = new HashCodeBuilder().append(sop)
                              .append(scale)
                              .append(hints)
                              .toHashCode();
}
 
Example 3
Project: flume-release-1.7.0   File: LogEntry.java   View source code 6 votes vote down vote up
@Override
public int hashCode() {
  HashCodeBuilder builder = new HashCodeBuilder();

  boolean present_category = true && (isSetCategory());
  builder.append(present_category);
  if (present_category)
    builder.append(category);

  boolean present_message = true && (isSetMessage());
  builder.append(present_message);
  if (present_message)
    builder.append(message);

  return builder.toHashCode();
}
 
Example 4
Project: Reer   File: WeaklyTypeReferencingMethod.java   View source code 5 votes vote down vote up
@Override
public int hashCode() {
    if (cachedHashCode != -1) {
        return cachedHashCode;
    }
    // there's a risk, for some methods, that the hash is always
    // recomputed but it won't be worse than before
    cachedHashCode = new HashCodeBuilder()
            .append(declaringType)
            .append(returnType)
            .append(name)
            .append(paramTypes)
            .toHashCode();
    return cachedHashCode;
}
 
Example 5
Project: Reer   File: NamespaceId.java   View source code 5 votes vote down vote up
@Override
public int hashCode() {
    return new HashCodeBuilder(17, 31)
            .append(namespace)
            .append(name)
            .toHashCode();
}
 
Example 6
Project: hadoop   File: CachePoolInfo.java   View source code 5 votes vote down vote up
@Override
public int hashCode() {
  return new HashCodeBuilder().
      append(poolName).
      append(ownerName).
      append(groupName).
      append(mode).
      append(limit).
      append(maxRelativeExpiryMs).
      hashCode();
}
 
Example 7
Project: morf   File: FieldReference.java   View source code 5 votes vote down vote up
/**
 * @see java.lang.Object#hashCode()
 */
@Override
public int hashCode() {
  return new HashCodeBuilder()
      .appendSuper(super.hashCode())
      .append(direction)
      .append(name)
      .append(nullValueHandling)
      .append(table)
      .toHashCode();
}
 
Example 8
Project: VASSAL-src   File: CropOpBitmapImpl.java   View source code 5 votes vote down vote up
/**
 * Constructs an <code>ImageOp</code> which will crop the image
 * produced by its source <code>ImageOp</code>.
 *
 * @param sop the source operation
 * @param x0 the x coordinate of the upper-left corner
 * @param y0 the y coordinate of the upper-left corner
 * @param x1 the x coordinate of the lower-right corner
 * @param y1 the y coordinate of the lower-right corner
 */
public CropOpBitmapImpl(ImageOp sop, int x0, int y0, int x1, int y1) {
  if (sop == null) {
    throw new IllegalArgumentException();
  }

  if (x0 < 0) {
    throw new IllegalArgumentException("left = " + x0);
  }

  if (y0 < 0) {
    throw new IllegalArgumentException("top = " + y0);
  }

  if (x1 <= x0) {
    throw new IllegalArgumentException("left = "+ x0 + ", right = " + x1);
  }

  if (y1 <= y0) {
    throw new IllegalArgumentException("top = " + y0 + ", bottom = " + y1);
  }

  this.sop = sop;
  this.x0 = x0;
  this.y0 = y0;
  this.x1 = x1;
  this.y1 = y1;

  size = new Dimension(x1-x0, y1-y0);

  hash = new HashCodeBuilder().append(sop)
                              .append(x0)
                              .append(y0)
                              .append(x1)
                              .append(y1)
                              .toHashCode();
}
 
Example 9
Project: ctsms   File: SelectionSetValueRowProcessor.java   View source code 5 votes vote down vote up
@Override
protected int lineHashCode(String[] values) {
	return new HashCodeBuilder(1249046965, -82296885)
	// .append(getFieldName(values))
	// .append(getValue(values))
	.append(getFieldName(values))
	.append(getName(values))
	.append(getValue(values))
	.append(getLocalized(values))
	.append(getPreset(values))
	.append(getStrokesId(values))
	.append(getInkRegions(values))
	.toHashCode();
}
 
Example 10
Project: VASSAL-src   File: SourceTileOpSVGImpl.java   View source code 5 votes vote down vote up
public SourceTileOpSVGImpl(SVGOp sop, int tileX, int tileY) {
  if (sop == null) throw new IllegalArgumentException();

  if (tileX < 0 || tileX >= sop.getNumXTiles() ||
      tileY < 0 || tileY >= sop.getNumYTiles())
    throw new IndexOutOfBoundsException();

  this.sop = sop;

  final int tw = sop.getTileWidth();
  final int th = sop.getTileHeight();
  final int sw = sop.getWidth();
  final int sh = sop.getHeight();

  x0 = tileX*tw;
  y0 = tileY*th;
  x1 = Math.min((tileX+1)*tw, sw);
  y1 = Math.min((tileY+1)*th, sh);

  size = new Dimension(x1-x0, y1-y0);

  hash = new HashCodeBuilder().append(sop)
                              .append(x0)
                              .append(y0)
                              .append(x1)
                              .append(y1)
                              .toHashCode();
}
 
Example 11
Project: VASSAL-src   File: OrthoRotateOpBitmapImpl.java   View source code 5 votes vote down vote up
public OrthoRotateOpBitmapImpl(ImageOp sop, int angle) {
  if (sop == null) throw new IllegalArgumentException();

  angle = (360 + (angle % 360)) % 360;  // put angle in [0,360)
  if (angle % 90 != 0) throw new IllegalArgumentException();

  // angle is now in { 0, 90, 180, 270 }.

  this.sop = sop;
  this.angle = angle / 90;

  hash = new HashCodeBuilder().append(sop)
                              .append(angle)
                              .toHashCode();
}
 
Example 12
Project: hadoop   File: ElasticByteBufferPool.java   View source code 5 votes vote down vote up
@Override
public int hashCode() {
  return new HashCodeBuilder().
      append(capacity).
      append(insertionTime).
      toHashCode();
}
 
Example 13
Project: jwala   File: JsonCreateApplication.java   View source code 5 votes vote down vote up
@Override
public int hashCode() {
    return new HashCodeBuilder().append(getGroupId())
            .append(getName())
            .append(getWebappContext())
            .append(isSecure())
            .append(isLoadBalanceAcrossServers())
            .append(isUnpackWar()).toHashCode();
}
 
Example 14
Project: hadoop   File: ShortCircuitShm.java   View source code 5 votes vote down vote up
@Override
public int hashCode() {
  return new HashCodeBuilder().
      append(this.hi).
      append(this.lo).
      toHashCode();
}
 
Example 15
Project: ctsms   File: OpsCodeLineProcessor.java   View source code 5 votes vote down vote up
private HashCodeBuilder getHashCodeBuilder(String[] values) {
	return new HashCodeBuilder(1249046965, -82296885)
	.append(getType(values))
	.append(getDimdiId(values))
	.append(getFirstCode(values))
	.append(getSecondCode(values))
	.append(getText(values));
}
 
Example 16
Project: hadoop   File: XAttr.java   View source code 5 votes vote down vote up
@Override
public int hashCode() {
  return new HashCodeBuilder(811, 67)
      .append(name)
      .append(ns)
      .append(value)
      .toHashCode();
}
 
Example 17
Project: jwala   File: JsonUpdateApplication.java   View source code 5 votes vote down vote up
@Override
public int hashCode() {
    return new HashCodeBuilder().append(getGroupId())
            .append(getName())
            .append(getWebappContext())
            .append(getWebappId())
            .append(isSecure())
            .append(isLoadBalanceAcrossServers())
            .append(isUnpackWar()).toHashCode();
}
 
Example 18
Project: living-documentation   File: Delivery.java   View source code 5 votes vote down vote up
@Override
public int hashCode() {
    return new HashCodeBuilder().
            append(transportStatus).
            append(lastKnownLocation).
            append(currentVoyage).
            append(misdirected).
            append(eta).
            append(nextExpectedActivity).
            append(isUnloadedAtDestination).
            append(routingStatus).
            append(calculatedAt).
            append(lastEvent).
            toHashCode();
}
 
Example 19
Project: ctsms   File: AlphaIdLineProcessor.java   View source code 5 votes vote down vote up
private HashCodeBuilder getHashCodeBuilder(String[] values) {
	return new HashCodeBuilder(1249046965, -82296885)
	.append(getValid(values))
	.append(getAlphaId(values))
	.append(getPrimaryCode(values))
	.append(getAsteriskCode(values))
	.append(getOptionalCode(values))
	.append(getText(values));
}
 
Example 20
Project: osc-core   File: Endpoint.java   View source code 5 votes vote down vote up
@Override
public int hashCode() {
    return new HashCodeBuilder()
            .append(getEndPointIP())
            .append(getDomainId())
            .append(getProject())
            .append(getUser())
            .append(getPassword())
            .append(isHttps())
            .toHashCode();
}
 
Example 21
Project: osc-core   File: Policy.java   View source code 5 votes vote down vote up
@Override
public int hashCode() {
	HashCodeBuilder builder = new HashCodeBuilder().append(getName()).append(getId());
	if (this.applianceManagerConnector != null) {
		builder.append(this.applianceManagerConnector.getId());
	}

	return builder.toHashCode();
}
 
Example 22
Project: ctsms   File: BankIdentificationLineProcessor.java   View source code 5 votes vote down vote up
@Override
protected int lineHashCode(String[] values) {
	return new HashCodeBuilder(1249046965, -82296885)
	.append(getBankName(values))
	.append(getBankCodeNumber(values))
	.toHashCode();
}
 
Example 23
Project: flume-release-1.7.0   File: ThriftSourceProtocol.java   View source code 5 votes vote down vote up
@Override
public int hashCode() {
  HashCodeBuilder builder = new HashCodeBuilder();

  boolean present_event = true && (isSetEvent());
  builder.append(present_event);
  if (present_event)
    builder.append(event);

  return builder.toHashCode();
}
 
Example 24
Project: flume-release-1.7.0   File: Scribe.java   View source code 5 votes vote down vote up
@Override
public int hashCode() {
  HashCodeBuilder builder = new HashCodeBuilder();

  boolean present_success = true && (isSetSuccess());
  builder.append(present_success);
  if (present_success)
    builder.append(success.getValue());

  return builder.toHashCode();
}
 
Example 25
Project: lams   File: LearningDesignAccess.java   View source code 4 votes vote down vote up
@Override
   public int hashCode() {
return new HashCodeBuilder().append(learningDesignId).append(userId).toHashCode();
   }
 
Example 26
Project: lams   File: Lesson.java   View source code 4 votes vote down vote up
@Override
   public int hashCode() {
return new HashCodeBuilder().append(getLessonId()).toHashCode();
   }
 
Example 27
Project: microservice-atom   File: InvoiceLine.java   View source code 4 votes vote down vote up
@Override
public int hashCode() {
	return HashCodeBuilder.reflectionHashCode(this);

}
 
Example 28
Project: Reer   File: StartParameter.java   View source code 4 votes vote down vote up
public int hashCode() {
    return HashCodeBuilder.reflectionHashCode(this);
}
 
Example 29
Project: lams   File: SpreadsheetMark.java   View source code 4 votes vote down vote up
@Override
   public int hashCode() {
return new HashCodeBuilder().append(getUid()).append(getComments()).append(getMarks())
	.append(getDateMarksReleased()).toHashCode();
   }
 
Example 30
Project: echo   File: Relationship.java   View source code 4 votes vote down vote up
@Override
public int hashCode() {
    return new HashCodeBuilder().append(name).append(autoTerminate).append(additionalProperties).toHashCode();
}
 
Example 31
Project: lams   File: KalturaComment.java   View source code 4 votes vote down vote up
@Override
   public int hashCode() {
return new HashCodeBuilder().append(uid).append(comment).append(createBy).toHashCode();
   }
 
Example 32
Project: echo   File: Config.java   View source code 4 votes vote down vote up
@Override
public int hashCode() {
    return new HashCodeBuilder().append(additionalProperties).toHashCode();
}
 
Example 33
Project: echo   File: Property.java   View source code 4 votes vote down vote up
@Override
public int hashCode() {
    return new HashCodeBuilder().append(additionalProperties).toHashCode();
}
 
Example 34
Project: lams   File: PeerreviewUser.java   View source code 4 votes vote down vote up
@Override
   public int hashCode() {
return new HashCodeBuilder().append(uid).append(firstName).append(lastName).append(loginName).toHashCode();
   }
 
Example 35
Project: microservice-kafka   File: Order.java   View source code 4 votes vote down vote up
@Override
public int hashCode() {
	return HashCodeBuilder.reflectionHashCode(this);
}
 
Example 36
Project: keti   File: SubjectEntity.java   View source code 4 votes vote down vote up
@Override
public int hashCode() {
    return new HashCodeBuilder().append(this.subjectIdentifier).append(this.zone).append(this.attributesAsJson)
            .append(this.parents).toHashCode();
}
 
Example 37
Project: distmq   File: BrokerClient.java   View source code 4 votes vote down vote up
@Override
public int hashCode() {
    return new HashCodeBuilder()
            .append(addressList)
            .toHashCode();
}
 
Example 38
Project: microservice-cloudfoundry   File: Item.java   View source code 4 votes vote down vote up
@Override
public int hashCode() {
	return HashCodeBuilder.reflectionHashCode(this);

}
 
Example 39
Project: microservice-cloudfoundry   File: Item.java   View source code 4 votes vote down vote up
@Override
public int hashCode() {
	return HashCodeBuilder.reflectionHashCode(this);

}
 
Example 40
Project: microservice-atom   File: Shipment.java   View source code 4 votes vote down vote up
@Override
public int hashCode() {
	return HashCodeBuilder.reflectionHashCode(this);
}