Package com.cedarsoft.couchdb.core

Examples of com.cedarsoft.couchdb.core.DocId


    assert rev != null;
    assert id != null;

    parser.ensureObjectClosed();

    return new UniqueId( new DocId( id ), new Revision( rev ) );

    //    AbstractJacksonSerializer.nextToken( deserializeFrom, JsonToken.FIELD_NAME );
    //    if ( deserializeFrom.getCurrentName().equals( PROPERTY_OK ) ) {
    //    } else {
    //      AbstractJacksonSerializer.nextToken( deserializeFrom, JsonToken.VALUE_STRING );
View Full Code Here


    //the attachments - if there are any....
    List<? extends CouchDoc.Attachment> attachments = deserializeAttachments( parserWrapper );

    parserWrapper.ensureObjectClosed();
    CouchDoc<T> doc = new CouchDoc<>( new DocId( id ), rev == null ? null : new Revision( rev ), wrapped );
    doc.addAttachments( attachments );
    return doc;
  }
View Full Code Here

  }

  public <K, V, D> void serialize( @Nonnull Row<K, V, D> row, @Nonnull JacksonSerializer<? super K> keySerializer, @Nonnull JacksonSerializer<? super V> valueSerializer, @Nullable JacksonSerializer<? super D> documentSerializer, @Nonnull JsonGenerator generator ) throws IOException {
    generator.writeStartObject();

    @Nullable DocId id = row.getId();
    if ( id != null ) {
      generator.writeStringField( PROPERTY_ID, id.asString() );
    }

    //The key
    generator.writeFieldName( PROPERTY_KEY );
    keySerializer.serialize( row.getKey(), generator );
View Full Code Here

    JacksonParserWrapper wrapper = new JacksonParserWrapper( parser );
    wrapper.nextToken( JsonToken.FIELD_NAME );
    String fieldName = wrapper.getCurrentName();

    //The id
    @Nullable final DocId id;
    if ( fieldName.equals( PROPERTY_ID ) ) {
      wrapper.nextValue();
      id = new DocId( wrapper.getText() );
      wrapper.nextField( PROPERTY_KEY );
    }else {
      id = null;
    }
View Full Code Here

    String rev = parser.getText();

    parser.nextToken();

    parserWrapper.ensureObjectClosed();
    return new RawCouchDoc( new DocId( id ), new Revision( rev ) );
  }
View Full Code Here

TOP

Related Classes of com.cedarsoft.couchdb.core.DocId

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.