@Override public String getValue() { return wrapped.getValue(); } }
@Nullable private String getComment(BsonValue<?> value) { if (value instanceof BsonString) { return ((BsonString) value).getValue(); } return null; }
@Override public Void visit(BsonString value, ByteBuf arg) { writeString(arg, value.getValue()); return null; }
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof BsonString)) { return false; } return this.getValue().equals(((BsonString) obj).getValue()); }
@Nullable private BsonDocument getHint(BsonValue<?> value) throws BadValueException { if (value instanceof BsonDocument) { return (BsonDocument) value; } if (value instanceof BsonString) { return new SingleEntryBsonDocument(((BsonString) value).getValue(), PrimitiveBsonDouble .newInstance(1)); } throw new BadValueException("$hint must be either a string or a nested object"); }
@Nonnull public static String getString(Entry<?> entry) throws TypesMismatchException { BsonValue object = entry.getValue(); if (!object.isString()) { throw new TypesMismatchException(entry.getKey(), "string", object.getType()); } return object.asString().getValue(); }
@Override public int compareTo(BsonValue<?> obj) { if (obj == this) { return 0; } int diff = BsonTypeComparator.INSTANCE.compare(getType(), obj.getType()); if (diff != 0) { return diff; } assert obj.isString(); return this.getValue().compareTo(obj.asString().getValue()); }
return new StringWriteConcern(syncMode, timeout, wValue.asString().getValue());
return new BsonString(((com.torodb.mongowp.bson.BsonString) value).getValue()); case TIMESTAMP: { com.torodb.mongowp.bson.BsonTimestamp casted =