Exemple #1
0
  public void fromString(String iRecordId) {
    if (iRecordId != null) iRecordId = iRecordId.trim();

    if (iRecordId == null || iRecordId.isEmpty()) {
      clusterId = CLUSTER_ID_INVALID;
      clusterPosition = CLUSTER_POS_INVALID;
      return;
    }

    if (!OStringSerializerHelper.contains(iRecordId, SEPARATOR))
      throw new IllegalArgumentException(
          "Argument '"
              + iRecordId
              + "' is not a RecordId in form of string. Format must be: <cluster-id>:<cluster-position>");

    final List<String> parts = OStringSerializerHelper.split(iRecordId, SEPARATOR, PREFIX);

    if (parts.size() != 2)
      throw new IllegalArgumentException(
          "Argument received '"
              + iRecordId
              + "' is not a RecordId in form of string. Format must be: #<cluster-id>:<cluster-position>. Example: #3:12");

    clusterId = Integer.parseInt(parts.get(0));
    checkClusterLimits();
    clusterPosition = OClusterPositionFactory.INSTANCE.valueOf(parts.get(1));
  }
Exemple #2
0
 public ORecordId(final int iClusterIdId) {
   clusterId = iClusterIdId;
   checkClusterLimits();
 }
Exemple #3
0
 public ORecordId(final int iClusterId, final OClusterPosition iPosition) {
   clusterId = iClusterId;
   checkClusterLimits();
   clusterPosition = iPosition;
 }