Package com.eaio.uuid

Examples of com.eaio.uuid.UUID


      }
    }

    @Override
    protected Object convertToType(String value) {
      UUID ud = new UUID(value);
      return ud;
    }
View Full Code Here


 
  public static class UUIDConverter extends BaseConverter {
   
    @Override
    public byte[] convertToNoSqlImpl(Object value) {
      UUID uid = (UUID) value;
        long time = uid.getTime();
        long clockSeqAndNode = uid.getClockSeqAndNode();
        byte[] timeArray = LONG_CONVERTER.convertToNoSql(time);
        byte[] nodeArray = LONG_CONVERTER.convertToNoSql(clockSeqAndNode);
        byte[] combinedUUID = new byte[timeArray.length + nodeArray.length];
        System.arraycopy(timeArray,0,combinedUUID,0         ,timeArray.length);
        System.arraycopy(nodeArray,0,combinedUUID,timeArray.length,nodeArray.length);
View Full Code Here

      byte[] clockSeqAndNodeArray=new byte[8];
      System.arraycopy(value,0,timeArray,0,8);
      System.arraycopy(value,8,clockSeqAndNodeArray,0,8);
      long time = StandardConverters.convertFromBytes(Long.class, timeArray);
      long clockSeqAndNode = StandardConverters.convertFromBytes(Long.class, clockSeqAndNodeArray);
      UUID ud = new UUID(time,clockSeqAndNode);
      return ud;
    }
View Full Code Here

      return ud;
    }

    @Override
    protected Object convertToType(String value) {
      UUID ud = new UUID(value);
      return ud;
    }
View Full Code Here

//            " are using a primitive for your key which is not a good idea either if you are going to use a generator(use Integer or String or Long instead)");
      return id;
    }
    Object newId;
    if (field.getType().equals(UUID.class))
      newId = new UUID();
    else
      newId = generator.generateNewKey(entity);
    ReflectionUtil.putFieldValue(entity, field, newId);
    return newId;
  }
View Full Code Here

 
  public static class UUIDConverter extends BaseConverter {
   
    @Override
    public byte[] convertToNoSqlImpl(Object value) {
      UUID uid = (UUID) value;
        long time = uid.getTime();
        long clockSeqAndNode = uid.getClockSeqAndNode();
        byte[] timeArray = LONG_CONVERTER.convertToNoSql(time);
        byte[] nodeArray = LONG_CONVERTER.convertToNoSql(clockSeqAndNode);
        byte[] combinedUUID = new byte[timeArray.length + nodeArray.length];
        System.arraycopy(timeArray,0,combinedUUID,0         ,timeArray.length);
        System.arraycopy(nodeArray,0,combinedUUID,timeArray.length,nodeArray.length);
View Full Code Here

      byte[] clockSeqAndNodeArray=new byte[8];
      System.arraycopy(value,0,timeArray,0,8);
      System.arraycopy(value,8,clockSeqAndNodeArray,0,8);
      long time = StandardConverters.convertFromBytes(Long.class, timeArray);
      long clockSeqAndNode = StandardConverters.convertFromBytes(Long.class, clockSeqAndNodeArray);
      UUID ud = new UUID(time,clockSeqAndNode);
      return ud;
    }
View Full Code Here

      return ud;
    }

    @Override
    protected Object convertToType(String value) {
      UUID ud = new UUID(value);
      return ud;
    }
View Full Code Here

* @author Allard Buijze
*/
public class FastUUIDIdentifierFactory extends IdentifierFactory {
    @Override
    public String generateIdentifier() {
        return new UUID().toString();
    }
View Full Code Here

* @author Allard Buijze
*/
public class FastUUIDIdentifierFactory extends IdentifierFactory {
    @Override
    public String generateIdentifier() {
        return new UUID().toString();
    }
View Full Code Here

TOP

Related Classes of com.eaio.uuid.UUID

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.