/** * Returns whether this metadata contains a given name. * * @param name the name to check. * @return {@code true} if this metadata contains the column named {@code name}, {@code false} * otherwise. */ public boolean contains(String name) { return findAllIdx(name) != null; }
int findFirstIdx(String name) { int[] indexes = findAllIdx(name); return indexes == null ? -1 : indexes[0]; }
int[] getAllIdx(String name) { int[] indexes = findAllIdx(name); if (indexes == null) throw new IllegalArgumentException(name + " is not a column defined in this metadata"); return indexes; }
private static boolean checkWasApplied( List<ByteBuffer> firstRow, ColumnDefinitions metadata, ProtocolVersion protocolVersion) { // If the column is not present or not a boolean, we assume the query // was not a conditional statement, and therefore return true. if (firstRow == null) return true; int[] is = metadata.findAllIdx("[applied]"); if (is == null) return true; int i = is[0]; if (!DataType.cboolean().equals(metadata.getType(i))) return true; // Otherwise return the value of the column ByteBuffer value = firstRow.get(i); if (value == null || value.remaining() == 0) return false; return TypeCodec.cboolean().deserializeNoBoxing(value, protocolVersion); } }
/** * Returns whether this metadata contains a given name. * * @param name the name to check. * @return {@code true} if this metadata contains the column named {@code name}, * {@code false} otherwise. */ public boolean contains(String name) { return findAllIdx(name) != null; }
int findFirstIdx(String name) { int[] indexes = findAllIdx(name); return indexes == null ? -1 : indexes[0]; }
/** * Returns whether this metadata contains a given name. * * @param name the name to check. * @return {@code true} if this metadata contains the column named {@code name}, * {@code false} otherwise. */ public boolean contains(String name) { return findAllIdx(name) != null; }
/** * Returns whether this metadata contains a given name. * * @param name the name to check. * @return {@code true} if this metadata contains the column named {@code name}, * {@code false} otherwise. */ public boolean contains(String name) { return findAllIdx(name) != null; }
/** * Returns whether this metadata contains a given name. * * @param name the name to check. * @return {@code true} if this metadata contains the column named {@code name}, * {@code false} otherwise. */ public boolean contains(String name) { return findAllIdx(name) != null; }
int findFirstIdx(String name) { int[] indexes = findAllIdx(name); return indexes == null ? -1 : indexes[0]; }
int findFirstIdx(String name) { int[] indexes = findAllIdx(name); return indexes == null ? -1 : indexes[0]; }
int findFirstIdx(String name) { int[] indexes = findAllIdx(name); return indexes == null ? -1 : indexes[0]; }
int[] getAllIdx(String name) { int[] indexes = findAllIdx(name); if (indexes == null) throw new IllegalArgumentException(name + " is not a column defined in this metadata"); return indexes; }
int[] getAllIdx(String name) { int[] indexes = findAllIdx(name); if (indexes == null) throw new IllegalArgumentException(name + " is not a column defined in this metadata"); return indexes; }
int[] getAllIdx(String name) { int[] indexes = findAllIdx(name); if (indexes == null) throw new IllegalArgumentException(name + " is not a column defined in this metadata"); return indexes; }
int[] getAllIdx(String name) { int[] indexes = findAllIdx(name); if (indexes == null) throw new IllegalArgumentException(name + " is not a column defined in this metadata"); return indexes; }
private static boolean checkWasApplied(List<ByteBuffer> firstRow, ColumnDefinitions metadata, ProtocolVersion protocolVersion) { // If the column is not present or not a boolean, we assume the query // was not a conditional statement, and therefore return true. if (firstRow == null) return true; int[] is = metadata.findAllIdx("[applied]"); if (is == null) return true; int i = is[0]; if (!DataType.cboolean().equals(metadata.getType(i))) return true; // Otherwise return the value of the column ByteBuffer value = firstRow.get(i); if (value == null || value.remaining() == 0) return false; return TypeCodec.cboolean().deserializeNoBoxing(value, protocolVersion); } }
private static boolean checkWasApplied(List<ByteBuffer> firstRow, ColumnDefinitions metadata, ProtocolVersion protocolVersion) { // If the column is not present or not a boolean, we assume the query // was not a conditional statement, and therefore return true. if (firstRow == null) return true; int[] is = metadata.findAllIdx("[applied]"); if (is == null) return true; int i = is[0]; if (!DataType.cboolean().equals(metadata.getType(i))) return true; // Otherwise return the value of the column ByteBuffer value = firstRow.get(i); if (value == null || value.remaining() == 0) return false; return TypeCodec.cboolean().deserializeNoBoxing(value, protocolVersion); } }
private static boolean checkWasApplied(List<ByteBuffer> firstRow, ColumnDefinitions metadata, ProtocolVersion protocolVersion) { // If the column is not present or not a boolean, we assume the query // was not a conditional statement, and therefore return true. if (firstRow == null) return true; int[] is = metadata.findAllIdx("[applied]"); if (is == null) return true; int i = is[0]; if (!DataType.cboolean().equals(metadata.getType(i))) return true; // Otherwise return the value of the column ByteBuffer value = firstRow.get(i); if (value == null || value.remaining() == 0) return false; return TypeCodec.cboolean().deserializeNoBoxing(value, protocolVersion); } }