示例#1
0
 @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);
   }
 }
示例#2
0
    @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);
    }
示例#3
0
 @Override
 public void save(final DataOutput out) {
   try {
     out.writeByte(ARRAY_TYPE);
     elementType.save(out);
   } catch (IOException e) {
     throw new BuildDataCorruptedException(e);
   }
 }
示例#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());
    }
  }
示例#5
0
 @Override
 public int hashCode() {
   return elementType.hashCode();
 }
示例#6
0
 @Override
 public void updateClassUsages(
     final DependencyContext context, final int owner, final Set<UsageRepr.Usage> s) {
   elementType.updateClassUsages(context, owner, s);
 }
示例#7
0
 @Override
 public String getDescr(final DependencyContext context) {
   return "[" + elementType.getDescr(context);
 }
示例#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;
 }