@Override
 public void save(final DataOutput out) {
   try {
     out.writeByte(CLASS_TYPE);
     DataInputOutputUtil.writeINT(out, className);
     DataInputOutputUtil.writeINT(out, typeArgs.length);
     for (AbstractType t : typeArgs) {
       t.save(out);
     }
   } catch (IOException e) {
     throw new BuildDataCorruptedException(e);
   }
 }
    @Override
    public boolean equals(Object o) {
      if (this == o) return true;
      if (o == null || getClass() != o.getClass()) return false;

      final ArrayType arrayType = (ArrayType) o;

      return elementType.equals(arrayType.elementType);
    }
 @Override
 public void save(final DataOutput out) {
   try {
     out.writeByte(ARRAY_TYPE);
     elementType.save(out);
   } catch (IOException e) {
     throw new BuildDataCorruptedException(e);
   }
 }
Exemple #4
0
  /**
   * Returns the typed value, serialized to a ByteBuffer according to a comparator/validator.
   *
   * @return a ByteBuffer of the value.
   * @throws InvalidRequestException if unable to coerce the string to its type.
   */
  public ByteBuffer getByteBuffer(AbstractType<?> validator, List<ByteBuffer> variables)
      throws InvalidRequestException {
    try {
      if (!isBindMarker()) return validator.fromStringCQL2(text);

      // must be a marker term so check for a CqlBindValue stored in the term
      if (bindIndex == null)
        throw new AssertionError("a marker Term was encountered with no index value");

      return variables.get(bindIndex);
    } catch (MarshalException e) {
      throw new InvalidRequestException(e.getMessage());
    }
  }
 @Override
 public int hashCode() {
   return elementType.hashCode();
 }
 @Override
 public void updateClassUsages(
     final DependencyContext context, final int owner, final Set<UsageRepr.Usage> s) {
   elementType.updateClassUsages(context, owner, s);
 }
 @Override
 public String getDescr(final DependencyContext context) {
   return "[" + elementType.getDescr(context);
 }
Exemple #8
0
 /**
  * Sets the abstract's AbstractType.
  *
  * @param abstractType the AbstractType.
  */
 public void setAbstractType(AbstractType abstractType) {
   this.abstractType = abstractType;
   this.abstractTypeCode = abstractType != null ? abstractType.getCode() : null;
 }