public static Value encodeDurationHistogram(List<Long> longs) { if (longs.size() != DURATION_HISTOGRAM_LENGTH) { throw new IllegalArgumentException("Incorrect number of items declared in Duration Histogram (should be 7)"); } EdgeValue.Builder builder = EdgeValue.newBuilder(); builder.addAllDuration(longs); return new Value(builder.build().toByteArray()); }
public static Value encodeActivityHistogram(List<Long> longs) { if (longs.size() != ACTIVITY_HISTOGRAM_LENGTH) { throw new IllegalArgumentException("Incorrect number of items declared in Activity Histogram (should be 24)"); } EdgeValue.Builder builder = EdgeValue.newBuilder(); builder.addAllHours(longs); return new Value(builder.build().toByteArray()); }
/** * <code>repeated int64 duration = 3 [packed = true];</code> * * <pre> * protobuf says that repeated order will be preserved * packed means it won't appear in serialized data * that doesn't contain any hours fields. * </pre> */ public Builder addAllDuration(java.lang.Iterable<? extends java.lang.Long> values) { ensureDurationIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, duration_); onChanged(); return this; }
return this; if (other.hasCount()) { setCount(other.getCount()); bitField0_ = (bitField0_ & ~0x00000002); } else { ensureHoursIsMutable(); hours_.addAll(other.hours_); onChanged(); bitField0_ = (bitField0_ & ~0x00000004); } else { ensureDurationIsMutable(); duration_.addAll(other.duration_); onChanged(); setHourBitmask(other.getHourBitmask()); onChanged(); onChanged(); onChanged(); setBadActivity(other.getBadActivity()); mergeUuid(other.getUuid());
public Value encode() { Builder builder = EdgeData.EdgeValue.newBuilder(); if (this.hasCount()) { builder.setCount(this.getCount()); } else { builder.setCount(0l); builder.setHourBitmask(this.getBitmask()); builder.setSourceValue(this.sourceValue); builder.setSinkValue(this.sinkValue); builder.addAllHours(this.hours); builder.addAllDuration(this.duration); builder.setLoadDate(loadDate); builder.setUuidString(this.uuidString); builder.setUuid(this.uuidObj); } else if (StringUtils.isNotBlank(this.uuidString)) { try { // try to parse the uuid string to a UUID object this.uuidObj = convertUuidStringToUuidObj(this.uuidString); builder.setUuid(this.uuidObj); } catch (Exception e) { builder.setUuidString(this.uuidString);
/** * <code>repeated int64 duration = 3 [packed = true];</code> * * <pre> * protobuf says that repeated order will be preserved * packed means it won't appear in serialized data * that doesn't contain any hours fields. * </pre> */ public Builder setDuration(int index, long value) { ensureDurationIsMutable(); duration_.set(index, value); onChanged(); return this; }
/** * <code>optional .datawave.edge.protobuf.EdgeValue.UUID uuid = 9;</code> * * <pre> * a single uuid of an event that contributed to the edge * </pre> */ private com.google.protobuf.SingleFieldBuilder<datawave.edge.protobuf.EdgeData.EdgeValue.UUID,datawave.edge.protobuf.EdgeData.EdgeValue.UUID.Builder,datawave.edge.protobuf.EdgeData.EdgeValue.UUIDOrBuilder> getUuidFieldBuilder() { if (uuidBuilder_ == null) { uuidBuilder_ = new com.google.protobuf.SingleFieldBuilder<datawave.edge.protobuf.EdgeData.EdgeValue.UUID,datawave.edge.protobuf.EdgeData.EdgeValue.UUID.Builder,datawave.edge.protobuf.EdgeData.EdgeValue.UUIDOrBuilder>( getUuid(), getParentForChildren(), isClean()); uuid_ = null; } return uuidBuilder_; }
/** * <code>repeated int64 duration = 3 [packed = true];</code> * * <pre> * protobuf says that repeated order will be preserved * packed means it won't appear in serialized data * that doesn't contain any hours fields. * </pre> */ public Builder addDuration(long value) { ensureDurationIsMutable(); duration_.add(value); onChanged(); return this; }
/** * <code>repeated int64 hours = 2 [packed = true];</code> * * <pre> * hour activity array (length 24) * </pre> */ public Builder setHours(int index, long value) { ensureHoursIsMutable(); hours_.set(index, value); onChanged(); return this; }
private static Builder create() { return new Builder(); }
public Builder clone() { return create().mergeFrom(buildPartial()); }
/** * <code>repeated int64 hours = 2 [packed = true];</code> * * <pre> * hour activity array (length 24) * </pre> */ public Builder addAllHours(java.lang.Iterable<? extends java.lang.Long> values) { ensureHoursIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, hours_); onChanged(); return this; }
/** * <code>repeated int64 hours = 2 [packed = true];</code> * * <pre> * hour activity array (length 24) * </pre> */ public Builder addHours(long value) { ensureHoursIsMutable(); hours_.add(value); onChanged(); return this; }
public datawave.edge.protobuf.EdgeData.EdgeValue build() { datawave.edge.protobuf.EdgeData.EdgeValue result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; }
@java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; }