diff --git a/build.gradle b/build.gradle index 1ccdb32..cec6e41 100644 --- a/build.gradle +++ b/build.gradle @@ -80,11 +80,6 @@ jacocoTestReport { xml.enabled = true csv.enabled = false } - afterEvaluate { - classDirectories.setFrom(files(classDirectories.files.collect { - fileTree(dir: it, exclude: 'tech/donau/behaiv/proto**') - })) - } } task proto(type: Exec) { diff --git a/src/main/java/de/dmi3y/behaiv/kernel/BaseKernel.java b/src/main/java/de/dmi3y/behaiv/kernel/BaseKernel.java deleted file mode 100644 index e2a4bb5..0000000 --- a/src/main/java/de/dmi3y/behaiv/kernel/BaseKernel.java +++ /dev/null @@ -1,97 +0,0 @@ -package de.dmi3y.behaiv.kernel; - -import com.fasterxml.jackson.databind.ObjectMapper; -import de.dmi3y.behaiv.storage.BehaivStorage; -import de.dmi3y.behaiv.tools.Pair; -import tech.donau.behaiv.proto.Data; -import tech.donau.behaiv.proto.Prediction; -import tech.donau.behaiv.proto.PredictionSet; - -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -public abstract class BaseKernel implements Kernel { - - protected String id; - protected Long treshold = 10L; - protected ObjectMapper objectMapper; - protected boolean partialFitAllowed = false; - protected boolean alwaysKeepData = true; - - public BaseKernel(String id) { - this.id = id; - objectMapper = new ObjectMapper(); - } - - - @Override - public void setId(String id) { - this.id = id; - } - - - //list, label - protected PredictionSet data = PredictionSet.newBuilder().addAllPrediction(new ArrayList()).build(); - - - @Override - public void fit() { - fit(this.data); - } - - @Override - public void setTreshold(Long treshold) { - this.treshold = treshold; - } - - @Override - public boolean readyToPredict() { - return data.getPredictionList().size() > treshold; - } - - @Override - public void update(List, String>> data) { - } - - @Override - public boolean isPartialFitAllowed() { - return partialFitAllowed; - } - - @Override - public void updateSingle(List features, String label) { - final Prediction.Builder predictionBuilder = Prediction.newBuilder(); - for (int i = 0; i < features.size(); i++) { - predictionBuilder.addData(Data.newBuilder().setKey("key" + i).setValue(features.get(i)).build()); - } - predictionBuilder.setLabel(label); - data = data.toBuilder().addPrediction(predictionBuilder.build()).build(); - } - - @Override - public boolean isAlwaysKeepData() { - return alwaysKeepData; - } - - @Override - public void setAlwaysKeepData(boolean alwaysKeepData) { - this.alwaysKeepData = alwaysKeepData; - } - - @Override - public void save(BehaivStorage storage) throws IOException { - try (final FileOutputStream writer = new FileOutputStream(storage.getDataFile(id))) { - data.writeTo(writer); - } - } - - @Override - public void restore(BehaivStorage storage) throws IOException { - try (final FileInputStream reader = new FileInputStream(storage.getDataFile(id))) { - data = PredictionSet.parseFrom(reader); - } - } -} diff --git a/src/main/java/de/dmi3y/behaiv/kernel/Kernel.java b/src/main/java/de/dmi3y/behaiv/kernel/Kernel.java index 8f915fa..ec414f5 100644 --- a/src/main/java/de/dmi3y/behaiv/kernel/Kernel.java +++ b/src/main/java/de/dmi3y/behaiv/kernel/Kernel.java @@ -1,41 +1,95 @@ package de.dmi3y.behaiv.kernel; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; import de.dmi3y.behaiv.storage.BehaivStorage; import de.dmi3y.behaiv.tools.Pair; -import tech.donau.behaiv.proto.PredictionSet; +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.FileReader; +import java.io.FileWriter; import java.io.IOException; +import java.util.ArrayList; import java.util.List; -public interface Kernel { - void setId(String id); +public abstract class Kernel { - boolean isEmpty(); + protected String id; + protected Long treshold = 10L; + protected ObjectMapper objectMapper; + protected boolean partialFitAllowed = false; + protected boolean alwaysKeepData = true; - @Deprecated - void fit(List, String>> data); + public Kernel(String id) { + this.id = id; + objectMapper = new ObjectMapper(); + } - void fit(PredictionSet data); - void fit(); + public void setId(String id) { + this.id = id; + } - void setTreshold(Long treshold); - boolean readyToPredict(); + //list, label + protected List, String>> data = new ArrayList<>(); - void update(List, String>> data); - boolean isPartialFitAllowed(); + public abstract boolean isEmpty(); - void updateSingle(List features, String label); + public abstract void fit(List, String>> data); - String predictOne(List features); + public void fit() { + fit(this.data); + } - boolean isAlwaysKeepData(); + public void setTreshold(Long treshold) { + this.treshold = treshold; + } - void setAlwaysKeepData(boolean alwaysKeepData); + public boolean readyToPredict() { + return data.size() > treshold; + } - void save(BehaivStorage storage) throws IOException; + public void update(List, String>> data) { + } - void restore(BehaivStorage storage) throws IOException; + public boolean isPartialFitAllowed() { + return partialFitAllowed; + } + + public void updateSingle(List features, String label) { + data.add(new Pair<>(features, label)); + } + + public abstract String predictOne(List features); + + public boolean isAlwaysKeepData() { + return alwaysKeepData; + } + + public void setAlwaysKeepData(boolean alwaysKeepData) { + this.alwaysKeepData = alwaysKeepData; + } + + public void save(BehaivStorage storage) throws IOException { + + try (final BufferedWriter writer = new BufferedWriter(new FileWriter(storage.getDataFile(id)))) { + writer.write(objectMapper.writeValueAsString(data)); + } + } + + public void restore(BehaivStorage storage) throws IOException { + final TypeReference, String>>> typeReference = new TypeReference, String>>>() { + }; + try (final BufferedReader reader = new BufferedReader(new FileReader(storage.getDataFile(id)))) { + final String content = reader.readLine(); + if (content == null || content.isEmpty()) { + data = new ArrayList<>(); + } else { + data = objectMapper.readValue(content, typeReference); + } + } + } } diff --git a/src/main/java/de/dmi3y/behaiv/kernel/LogisticRegressionKernel.java b/src/main/java/de/dmi3y/behaiv/kernel/LogisticRegressionKernel.java index f15a9e6..5205d25 100644 --- a/src/main/java/de/dmi3y/behaiv/kernel/LogisticRegressionKernel.java +++ b/src/main/java/de/dmi3y/behaiv/kernel/LogisticRegressionKernel.java @@ -3,27 +3,23 @@ import com.fasterxml.jackson.core.type.TypeReference; import de.dmi3y.behaiv.kernel.logistic.LogisticUtils; import de.dmi3y.behaiv.storage.BehaivStorage; -import de.dmi3y.behaiv.tools.DataMappingUtils; import de.dmi3y.behaiv.tools.Pair; import org.apache.commons.lang3.ArrayUtils; import org.ejml.simple.SimpleMatrix; -import tech.donau.behaiv.proto.PredictionSet; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; +import java.util.*; import static de.dmi3y.behaiv.tools.DataMappingUtils.toDistinctListOfPairValues; import static de.dmi3y.behaiv.tools.DataMappingUtils.toInput2dArray; -public class LogisticRegressionKernel extends BaseKernel { +public class LogisticRegressionKernel extends Kernel { - protected List cachedLables = new ArrayList<>(); + protected List labels = new ArrayList<>(); private Random rand; protected SimpleMatrix theta; @@ -39,64 +35,24 @@ public LogisticRegressionKernel(String id) { @Override public boolean isEmpty() { - return theta == null && data.getPredictionCount() == 0; + return theta == null && data.size() == 0; } + @Override - public void fit(PredictionSet data) { + public void fit(List, String>> data) { this.data = data; - if (data.getDynamicColumns()) { - throw new UnsupportedOperationException("LogisticRegressionKernel doesn't support dynamic fields"); - } - for (int i = 0; i < data.getPredictionList().size(); i++) { - cachedLables.add(data.getPredictionList().get(i).getLabel()); - } + labels = toDistinctListOfPairValues(data); if (readyToPredict()) { - //features - double[][] inputs = toInput2dArray(data); - - //labels - double[][] labelArray = new double[data.getPredictionCount()][cachedLables.size()]; - for (int i = 0; i < data.getPredictionCount(); i++) { - int dummyPos = cachedLables.indexOf(data.getPrediction(i).getLabel()); - labelArray[i][dummyPos] = 1.0; - } - - //output layer - final SimpleMatrix inputMatrix = new SimpleMatrix(inputs); - final SimpleMatrix outputMatrix = new SimpleMatrix(labelArray); - //3x4? - - //TODO dilemma on if we need to re-do theta or keep it as-is, if new features arrising we'll have a problem - if (theta == null || (theta.numCols() != cachedLables.size() && alwaysKeepData)) { - theta = SimpleMatrix.random_DDRM(inputMatrix.numCols(), outputMatrix.numCols(), 0, 1, rand); - } else if (theta.numCols() != cachedLables.size() && !alwaysKeepData) { - throw new UnsupportedOperationException( - "Partial fit of LogisticRegressionKernel is not supported. " + - "Number of labels differs from trained model." + - " Consider setting alwaysKeepData to true or changing Kernel that supports partial fit." - ); - } - - for (int i = 0; i < 10000; i++) { - theta = LogisticUtils.gradientDescent(inputMatrix, theta, outputMatrix, 0.1); - } - } - } - @Override - public void fit(List, String>> data) { - this.data = DataMappingUtils.createPredictionSet(data); - this.cachedLables = toDistinctListOfPairValues(data); - if (readyToPredict()) { //features double[][] inputs = toInput2dArray(data); //labels - double[][] labelArray = new double[data.size()][cachedLables.size()]; + double[][] labelArray = new double[data.size()][labels.size()]; for (int i = 0; i < data.size(); i++) { - int dummyPos = cachedLables.indexOf(data.get(i).getValue()); + int dummyPos = labels.indexOf(data.get(i).getValue()); labelArray[i][dummyPos] = 1.0; } @@ -106,9 +62,9 @@ public void fit(List, String>> data) { //3x4? //TODO dilemma on if we need to re-do theta or keep it as-is, if new features arrising we'll have a problem - if (theta == null || (theta.numCols() != cachedLables.size() && alwaysKeepData)) { + if (theta == null || (theta.numCols() != labels.size() && alwaysKeepData)) { theta = SimpleMatrix.random_DDRM(inputMatrix.numCols(), outputMatrix.numCols(), 0, 1, rand); - } else if (theta.numCols() != cachedLables.size() && !alwaysKeepData) { + } else if (theta.numCols() != labels.size() && !alwaysKeepData) { throw new UnsupportedOperationException( "Partial fit of LogisticRegressionKernel is not supported. " + "Number of labels differs from trained model." + @@ -136,6 +92,8 @@ public void updateSingle(List features, String label) { @Override public String predictOne(List features) { + + final double[] doubles = ArrayUtils.toPrimitive(features.toArray(new Double[0])); final SimpleMatrix inputs = new SimpleMatrix(new double[][]{doubles}); @@ -148,21 +106,18 @@ public String predictOne(List features) { maxPosition = i; } } - return cachedLables.get(maxPosition); + return labels.get(maxPosition); } @Override public void save(BehaivStorage storage) throws IOException { - if (theta == null && (data == null || data.getPredictionList().isEmpty())) { + if (theta == null && (data == null || data.isEmpty())) { throw new IOException("Not enough data to save, network data is empty"); } - if (cachedLables == null || cachedLables.isEmpty()) { - cachedLables = new ArrayList<>(); - for (int i = 0; i < data.getPredictionList().size(); i++) { - cachedLables.add(data.getPredictionList().get(i).getLabel()); - } + if(labels == null || labels.isEmpty()) { + labels = toDistinctListOfPairValues(data); } - if (cachedLables.isEmpty()) { + if (labels.isEmpty()) { String message; message = "Kernel collected data but failed to get labels, couldn't save network."; throw new IOException(message); @@ -176,7 +131,7 @@ public void save(BehaivStorage storage) throws IOException { theta.saveToFileBinary(storage.getNetworkFile(id).toString()); try (final BufferedWriter writer = new BufferedWriter(new FileWriter(storage.getNetworkMetadataFile(id)))) { - writer.write(objectMapper.writeValueAsString(cachedLables)); + writer.write(objectMapper.writeValueAsString(labels)); } catch (Exception e) { e.printStackTrace(); } @@ -202,9 +157,9 @@ public void restore(BehaivStorage storage) throws IOException { }; final String labelsData = reader.readLine(); if (labelsData == null) { - cachedLables = new ArrayList<>(); + labels = new ArrayList<>(); } else { - cachedLables = objectMapper.readValue(labelsData, typeReference); + labels = objectMapper.readValue(labelsData, typeReference); } } catch (IOException e) { e.printStackTrace(); diff --git a/src/main/java/de/dmi3y/behaiv/tools/DataMappingUtils.java b/src/main/java/de/dmi3y/behaiv/tools/DataMappingUtils.java index 94cc1d7..a66f278 100644 --- a/src/main/java/de/dmi3y/behaiv/tools/DataMappingUtils.java +++ b/src/main/java/de/dmi3y/behaiv/tools/DataMappingUtils.java @@ -1,42 +1,23 @@ package de.dmi3y.behaiv.tools; import org.apache.commons.lang3.ArrayUtils; -import tech.donau.behaiv.proto.Data; -import tech.donau.behaiv.proto.Prediction; -import tech.donau.behaiv.proto.PredictionSet; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; -public final class DataMappingUtils { +public final class DataMappingUtils +{ private DataMappingUtils() { // Unused utility class } - public static PredictionSet createPredictionSet(List, String>> data) { - final PredictionSet.Builder predictionSetBuilder = PredictionSet.newBuilder(); - for (int i = 0; i < data.size(); i++) { - final List weights = data.get(i).getKey(); - final ArrayList row = new ArrayList<>(); - for (int j = 0; j < weights.size(); j++) { - row.add(Data.newBuilder().setKey("key" + j).setValue(weights.get(j)).build()); - } - predictionSetBuilder.addPrediction( - Prediction.newBuilder() - .addAllData(row) - .setLabel(data.get(i).getValue()) - .build() - ); - } - return predictionSetBuilder.buildPartial(); - } public static List toDistinctListOfPairValues(List, String>> data) { Set setOfValues = new HashSet<>(); - for (Pair, String> arrayListStringPair : data) { + for(Pair, String> arrayListStringPair : data ) { setOfValues.add(arrayListStringPair.getValue()); } return new ArrayList<>(setOfValues); @@ -61,20 +42,4 @@ public static double[][] toInput2dArray(List, String>> data) { return input2dArray; } - public static double[][] toInput2dArray(PredictionSet data) { - double[][] input2dArray = new double[data.getPredictionCount()][]; - final List predictionList = data.getPredictionList(); - for (int i = 0; i < predictionList.size(); i++) { - final Prediction prediction = predictionList.get(i); - final List row = prediction.getDataList(); - final double[] doubleRow = new double[row.size()]; - for (int j = 0; j < row.size(); j++) { - doubleRow[j] = row.get(j).getValue(); - } - input2dArray[i] = doubleRow; - } - - return input2dArray; - } - } diff --git a/src/main/java/de/dmi3y/behaiv/tools/Pair.java b/src/main/java/de/dmi3y/behaiv/tools/Pair.java index 9cd9b98..da0fe93 100644 --- a/src/main/java/de/dmi3y/behaiv/tools/Pair.java +++ b/src/main/java/de/dmi3y/behaiv/tools/Pair.java @@ -14,6 +14,9 @@ public Pair(de.dmi3y.behaiv.tools.Pair entry) { this(entry.getKey(), entry.getValue()); } + public Pair() { + } + public K getKey() { return this.key; } diff --git a/src/main/java/tech/donau/behaiv/proto/Action.java b/src/main/java/tech/donau/behaiv/proto/Action.java deleted file mode 100644 index 942d4f8..0000000 --- a/src/main/java/tech/donau/behaiv/proto/Action.java +++ /dev/null @@ -1,1379 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: behaiv.proto - -package tech.donau.behaiv.proto; - -/** - *
- * Communication messages
- * 
- * - * Protobuf type {@code Action} - */ -public final class Action extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:Action) - ActionOrBuilder { -private static final long serialVersionUID = 0L; - // Use Action.newBuilder() to construct. - private Action(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Action() { - action_ = ""; - object_ = ""; - screenStack_ = emptyIntList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Action(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Action( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - localId_ = input.readInt64(); - break; - } - case 16: { - - prevLocalId_ = input.readInt64(); - break; - } - case 26: { - java.lang.String s = input.readStringRequireUtf8(); - - action_ = s; - break; - } - case 34: { - java.lang.String s = input.readStringRequireUtf8(); - - object_ = s; - break; - } - case 40: { - - currentScreenId_ = input.readInt32(); - break; - } - case 48: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - screenStack_ = newIntList(); - mutable_bitField0_ |= 0x00000001; - } - screenStack_.addInt(input.readInt32()); - break; - } - case 50: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { - screenStack_ = newIntList(); - mutable_bitField0_ |= 0x00000001; - } - while (input.getBytesUntilLimit() > 0) { - screenStack_.addInt(input.readInt32()); - } - input.popLimit(limit); - break; - } - case 66: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - attributes_ = com.google.protobuf.MapField.newMapField( - AttributesDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000002; - } - com.google.protobuf.MapEntry - attributes__ = input.readMessage( - AttributesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); - attributes_.getMutableMap().put( - attributes__.getKey(), attributes__.getValue()); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - screenStack_.makeImmutable(); // C - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return tech.donau.behaiv.proto.Behaiv.internal_static_Action_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - @java.lang.Override - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 8: - return internalGetAttributes(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return tech.donau.behaiv.proto.Behaiv.internal_static_Action_fieldAccessorTable - .ensureFieldAccessorsInitialized( - tech.donau.behaiv.proto.Action.class, tech.donau.behaiv.proto.Action.Builder.class); - } - - public static final int LOCAL_ID_FIELD_NUMBER = 1; - private long localId_; - /** - * int64 local_id = 1; - * @return The localId. - */ - public long getLocalId() { - return localId_; - } - - public static final int PREV_LOCAL_ID_FIELD_NUMBER = 2; - private long prevLocalId_; - /** - * int64 prev_local_id = 2; - * @return The prevLocalId. - */ - public long getPrevLocalId() { - return prevLocalId_; - } - - public static final int ACTION_FIELD_NUMBER = 3; - private volatile java.lang.Object action_; - /** - * string action = 3; - * @return The action. - */ - public java.lang.String getAction() { - java.lang.Object ref = action_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - action_ = s; - return s; - } - } - /** - * string action = 3; - * @return The bytes for action. - */ - public com.google.protobuf.ByteString - getActionBytes() { - java.lang.Object ref = action_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - action_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int OBJECT_FIELD_NUMBER = 4; - private volatile java.lang.Object object_; - /** - * string object = 4; - * @return The object. - */ - public java.lang.String getObject() { - java.lang.Object ref = object_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - object_ = s; - return s; - } - } - /** - * string object = 4; - * @return The bytes for object. - */ - public com.google.protobuf.ByteString - getObjectBytes() { - java.lang.Object ref = object_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - object_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int CURRENT_SCREEN_ID_FIELD_NUMBER = 5; - private int currentScreenId_; - /** - * int32 current_screen_id = 5; - * @return The currentScreenId. - */ - public int getCurrentScreenId() { - return currentScreenId_; - } - - public static final int SCREEN_STACK_FIELD_NUMBER = 6; - private com.google.protobuf.Internal.IntList screenStack_; - /** - *
-   *    repeated Event events = 7; TODO
-   * 
- * - * repeated int32 screen_stack = 6; - * @return A list containing the screenStack. - */ - public java.util.List - getScreenStackList() { - return screenStack_; - } - /** - *
-   *    repeated Event events = 7; TODO
-   * 
- * - * repeated int32 screen_stack = 6; - * @return The count of screenStack. - */ - public int getScreenStackCount() { - return screenStack_.size(); - } - /** - *
-   *    repeated Event events = 7; TODO
-   * 
- * - * repeated int32 screen_stack = 6; - * @param index The index of the element to return. - * @return The screenStack at the given index. - */ - public int getScreenStack(int index) { - return screenStack_.getInt(index); - } - private int screenStackMemoizedSerializedSize = -1; - - public static final int ATTRIBUTES_FIELD_NUMBER = 8; - private static final class AttributesDefaultEntryHolder { - static final com.google.protobuf.MapEntry< - java.lang.String, java.lang.String> defaultEntry = - com.google.protobuf.MapEntry - .newDefaultInstance( - tech.donau.behaiv.proto.Behaiv.internal_static_Action_AttributesEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - } - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> attributes_; - private com.google.protobuf.MapField - internalGetAttributes() { - if (attributes_ == null) { - return com.google.protobuf.MapField.emptyMapField( - AttributesDefaultEntryHolder.defaultEntry); - } - return attributes_; - } - - public int getAttributesCount() { - return internalGetAttributes().getMap().size(); - } - /** - * map<string, string> attributes = 8; - */ - - public boolean containsAttributes( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetAttributes().getMap().containsKey(key); - } - /** - * Use {@link #getAttributesMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getAttributes() { - return getAttributesMap(); - } - /** - * map<string, string> attributes = 8; - */ - - public java.util.Map getAttributesMap() { - return internalGetAttributes().getMap(); - } - /** - * map<string, string> attributes = 8; - */ - - public java.lang.String getAttributesOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttributes().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, string> attributes = 8; - */ - - public java.lang.String getAttributesOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttributes().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (localId_ != 0L) { - output.writeInt64(1, localId_); - } - if (prevLocalId_ != 0L) { - output.writeInt64(2, prevLocalId_); - } - if (!getActionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, action_); - } - if (!getObjectBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, object_); - } - if (currentScreenId_ != 0) { - output.writeInt32(5, currentScreenId_); - } - if (getScreenStackList().size() > 0) { - output.writeUInt32NoTag(50); - output.writeUInt32NoTag(screenStackMemoizedSerializedSize); - } - for (int i = 0; i < screenStack_.size(); i++) { - output.writeInt32NoTag(screenStack_.getInt(i)); - } - com.google.protobuf.GeneratedMessageV3 - .serializeStringMapTo( - output, - internalGetAttributes(), - AttributesDefaultEntryHolder.defaultEntry, - 8); - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (localId_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, localId_); - } - if (prevLocalId_ != 0L) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, prevLocalId_); - } - if (!getActionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, action_); - } - if (!getObjectBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, object_); - } - if (currentScreenId_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(5, currentScreenId_); - } - { - int dataSize = 0; - for (int i = 0; i < screenStack_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(screenStack_.getInt(i)); - } - size += dataSize; - if (!getScreenStackList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream - .computeInt32SizeNoTag(dataSize); - } - screenStackMemoizedSerializedSize = dataSize; - } - for (java.util.Map.Entry entry - : internalGetAttributes().getMap().entrySet()) { - com.google.protobuf.MapEntry - attributes__ = AttributesDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, attributes__); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof tech.donau.behaiv.proto.Action)) { - return super.equals(obj); - } - tech.donau.behaiv.proto.Action other = (tech.donau.behaiv.proto.Action) obj; - - if (getLocalId() - != other.getLocalId()) return false; - if (getPrevLocalId() - != other.getPrevLocalId()) return false; - if (!getAction() - .equals(other.getAction())) return false; - if (!getObject() - .equals(other.getObject())) return false; - if (getCurrentScreenId() - != other.getCurrentScreenId()) return false; - if (!getScreenStackList() - .equals(other.getScreenStackList())) return false; - if (!internalGetAttributes().equals( - other.internalGetAttributes())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + LOCAL_ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getLocalId()); - hash = (37 * hash) + PREV_LOCAL_ID_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - getPrevLocalId()); - hash = (37 * hash) + ACTION_FIELD_NUMBER; - hash = (53 * hash) + getAction().hashCode(); - hash = (37 * hash) + OBJECT_FIELD_NUMBER; - hash = (53 * hash) + getObject().hashCode(); - hash = (37 * hash) + CURRENT_SCREEN_ID_FIELD_NUMBER; - hash = (53 * hash) + getCurrentScreenId(); - if (getScreenStackCount() > 0) { - hash = (37 * hash) + SCREEN_STACK_FIELD_NUMBER; - hash = (53 * hash) + getScreenStackList().hashCode(); - } - if (!internalGetAttributes().getMap().isEmpty()) { - hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; - hash = (53 * hash) + internalGetAttributes().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static tech.donau.behaiv.proto.Action parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static tech.donau.behaiv.proto.Action parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static tech.donau.behaiv.proto.Action parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static tech.donau.behaiv.proto.Action parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static tech.donau.behaiv.proto.Action parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static tech.donau.behaiv.proto.Action parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static tech.donau.behaiv.proto.Action parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static tech.donau.behaiv.proto.Action parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static tech.donau.behaiv.proto.Action parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static tech.donau.behaiv.proto.Action parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static tech.donau.behaiv.proto.Action parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static tech.donau.behaiv.proto.Action parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(tech.donau.behaiv.proto.Action prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Communication messages
-   * 
- * - * Protobuf type {@code Action} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:Action) - tech.donau.behaiv.proto.ActionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return tech.donau.behaiv.proto.Behaiv.internal_static_Action_descriptor; - } - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMapField( - int number) { - switch (number) { - case 8: - return internalGetAttributes(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapField internalGetMutableMapField( - int number) { - switch (number) { - case 8: - return internalGetMutableAttributes(); - default: - throw new RuntimeException( - "Invalid map field number: " + number); - } - } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return tech.donau.behaiv.proto.Behaiv.internal_static_Action_fieldAccessorTable - .ensureFieldAccessorsInitialized( - tech.donau.behaiv.proto.Action.class, tech.donau.behaiv.proto.Action.Builder.class); - } - - // Construct using tech.donau.behaiv.proto.Action.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - localId_ = 0L; - - prevLocalId_ = 0L; - - action_ = ""; - - object_ = ""; - - currentScreenId_ = 0; - - screenStack_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000001); - internalGetMutableAttributes().clear(); - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return tech.donau.behaiv.proto.Behaiv.internal_static_Action_descriptor; - } - - @java.lang.Override - public tech.donau.behaiv.proto.Action getDefaultInstanceForType() { - return tech.donau.behaiv.proto.Action.getDefaultInstance(); - } - - @java.lang.Override - public tech.donau.behaiv.proto.Action build() { - tech.donau.behaiv.proto.Action result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public tech.donau.behaiv.proto.Action buildPartial() { - tech.donau.behaiv.proto.Action result = new tech.donau.behaiv.proto.Action(this); - int from_bitField0_ = bitField0_; - result.localId_ = localId_; - result.prevLocalId_ = prevLocalId_; - result.action_ = action_; - result.object_ = object_; - result.currentScreenId_ = currentScreenId_; - if (((bitField0_ & 0x00000001) != 0)) { - screenStack_.makeImmutable(); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.screenStack_ = screenStack_; - result.attributes_ = internalGetAttributes(); - result.attributes_.makeImmutable(); - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof tech.donau.behaiv.proto.Action) { - return mergeFrom((tech.donau.behaiv.proto.Action)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(tech.donau.behaiv.proto.Action other) { - if (other == tech.donau.behaiv.proto.Action.getDefaultInstance()) return this; - if (other.getLocalId() != 0L) { - setLocalId(other.getLocalId()); - } - if (other.getPrevLocalId() != 0L) { - setPrevLocalId(other.getPrevLocalId()); - } - if (!other.getAction().isEmpty()) { - action_ = other.action_; - onChanged(); - } - if (!other.getObject().isEmpty()) { - object_ = other.object_; - onChanged(); - } - if (other.getCurrentScreenId() != 0) { - setCurrentScreenId(other.getCurrentScreenId()); - } - if (!other.screenStack_.isEmpty()) { - if (screenStack_.isEmpty()) { - screenStack_ = other.screenStack_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureScreenStackIsMutable(); - screenStack_.addAll(other.screenStack_); - } - onChanged(); - } - internalGetMutableAttributes().mergeFrom( - other.internalGetAttributes()); - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - tech.donau.behaiv.proto.Action parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (tech.donau.behaiv.proto.Action) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private long localId_ ; - /** - * int64 local_id = 1; - * @return The localId. - */ - public long getLocalId() { - return localId_; - } - /** - * int64 local_id = 1; - * @param value The localId to set. - * @return This builder for chaining. - */ - public Builder setLocalId(long value) { - - localId_ = value; - onChanged(); - return this; - } - /** - * int64 local_id = 1; - * @return This builder for chaining. - */ - public Builder clearLocalId() { - - localId_ = 0L; - onChanged(); - return this; - } - - private long prevLocalId_ ; - /** - * int64 prev_local_id = 2; - * @return The prevLocalId. - */ - public long getPrevLocalId() { - return prevLocalId_; - } - /** - * int64 prev_local_id = 2; - * @param value The prevLocalId to set. - * @return This builder for chaining. - */ - public Builder setPrevLocalId(long value) { - - prevLocalId_ = value; - onChanged(); - return this; - } - /** - * int64 prev_local_id = 2; - * @return This builder for chaining. - */ - public Builder clearPrevLocalId() { - - prevLocalId_ = 0L; - onChanged(); - return this; - } - - private java.lang.Object action_ = ""; - /** - * string action = 3; - * @return The action. - */ - public java.lang.String getAction() { - java.lang.Object ref = action_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - action_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string action = 3; - * @return The bytes for action. - */ - public com.google.protobuf.ByteString - getActionBytes() { - java.lang.Object ref = action_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - action_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string action = 3; - * @param value The action to set. - * @return This builder for chaining. - */ - public Builder setAction( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - action_ = value; - onChanged(); - return this; - } - /** - * string action = 3; - * @return This builder for chaining. - */ - public Builder clearAction() { - - action_ = getDefaultInstance().getAction(); - onChanged(); - return this; - } - /** - * string action = 3; - * @param value The bytes for action to set. - * @return This builder for chaining. - */ - public Builder setActionBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - action_ = value; - onChanged(); - return this; - } - - private java.lang.Object object_ = ""; - /** - * string object = 4; - * @return The object. - */ - public java.lang.String getObject() { - java.lang.Object ref = object_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - object_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string object = 4; - * @return The bytes for object. - */ - public com.google.protobuf.ByteString - getObjectBytes() { - java.lang.Object ref = object_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - object_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string object = 4; - * @param value The object to set. - * @return This builder for chaining. - */ - public Builder setObject( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - object_ = value; - onChanged(); - return this; - } - /** - * string object = 4; - * @return This builder for chaining. - */ - public Builder clearObject() { - - object_ = getDefaultInstance().getObject(); - onChanged(); - return this; - } - /** - * string object = 4; - * @param value The bytes for object to set. - * @return This builder for chaining. - */ - public Builder setObjectBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - object_ = value; - onChanged(); - return this; - } - - private int currentScreenId_ ; - /** - * int32 current_screen_id = 5; - * @return The currentScreenId. - */ - public int getCurrentScreenId() { - return currentScreenId_; - } - /** - * int32 current_screen_id = 5; - * @param value The currentScreenId to set. - * @return This builder for chaining. - */ - public Builder setCurrentScreenId(int value) { - - currentScreenId_ = value; - onChanged(); - return this; - } - /** - * int32 current_screen_id = 5; - * @return This builder for chaining. - */ - public Builder clearCurrentScreenId() { - - currentScreenId_ = 0; - onChanged(); - return this; - } - - private com.google.protobuf.Internal.IntList screenStack_ = emptyIntList(); - private void ensureScreenStackIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - screenStack_ = mutableCopy(screenStack_); - bitField0_ |= 0x00000001; - } - } - /** - *
-     *    repeated Event events = 7; TODO
-     * 
- * - * repeated int32 screen_stack = 6; - * @return A list containing the screenStack. - */ - public java.util.List - getScreenStackList() { - return ((bitField0_ & 0x00000001) != 0) ? - java.util.Collections.unmodifiableList(screenStack_) : screenStack_; - } - /** - *
-     *    repeated Event events = 7; TODO
-     * 
- * - * repeated int32 screen_stack = 6; - * @return The count of screenStack. - */ - public int getScreenStackCount() { - return screenStack_.size(); - } - /** - *
-     *    repeated Event events = 7; TODO
-     * 
- * - * repeated int32 screen_stack = 6; - * @param index The index of the element to return. - * @return The screenStack at the given index. - */ - public int getScreenStack(int index) { - return screenStack_.getInt(index); - } - /** - *
-     *    repeated Event events = 7; TODO
-     * 
- * - * repeated int32 screen_stack = 6; - * @param index The index to set the value at. - * @param value The screenStack to set. - * @return This builder for chaining. - */ - public Builder setScreenStack( - int index, int value) { - ensureScreenStackIsMutable(); - screenStack_.setInt(index, value); - onChanged(); - return this; - } - /** - *
-     *    repeated Event events = 7; TODO
-     * 
- * - * repeated int32 screen_stack = 6; - * @param value The screenStack to add. - * @return This builder for chaining. - */ - public Builder addScreenStack(int value) { - ensureScreenStackIsMutable(); - screenStack_.addInt(value); - onChanged(); - return this; - } - /** - *
-     *    repeated Event events = 7; TODO
-     * 
- * - * repeated int32 screen_stack = 6; - * @param values The screenStack to add. - * @return This builder for chaining. - */ - public Builder addAllScreenStack( - java.lang.Iterable values) { - ensureScreenStackIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, screenStack_); - onChanged(); - return this; - } - /** - *
-     *    repeated Event events = 7; TODO
-     * 
- * - * repeated int32 screen_stack = 6; - * @return This builder for chaining. - */ - public Builder clearScreenStack() { - screenStack_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - - private com.google.protobuf.MapField< - java.lang.String, java.lang.String> attributes_; - private com.google.protobuf.MapField - internalGetAttributes() { - if (attributes_ == null) { - return com.google.protobuf.MapField.emptyMapField( - AttributesDefaultEntryHolder.defaultEntry); - } - return attributes_; - } - private com.google.protobuf.MapField - internalGetMutableAttributes() { - onChanged();; - if (attributes_ == null) { - attributes_ = com.google.protobuf.MapField.newMapField( - AttributesDefaultEntryHolder.defaultEntry); - } - if (!attributes_.isMutable()) { - attributes_ = attributes_.copy(); - } - return attributes_; - } - - public int getAttributesCount() { - return internalGetAttributes().getMap().size(); - } - /** - * map<string, string> attributes = 8; - */ - - public boolean containsAttributes( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - return internalGetAttributes().getMap().containsKey(key); - } - /** - * Use {@link #getAttributesMap()} instead. - */ - @java.lang.Deprecated - public java.util.Map getAttributes() { - return getAttributesMap(); - } - /** - * map<string, string> attributes = 8; - */ - - public java.util.Map getAttributesMap() { - return internalGetAttributes().getMap(); - } - /** - * map<string, string> attributes = 8; - */ - - public java.lang.String getAttributesOrDefault( - java.lang.String key, - java.lang.String defaultValue) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttributes().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - /** - * map<string, string> attributes = 8; - */ - - public java.lang.String getAttributesOrThrow( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - java.util.Map map = - internalGetAttributes().getMap(); - if (!map.containsKey(key)) { - throw new java.lang.IllegalArgumentException(); - } - return map.get(key); - } - - public Builder clearAttributes() { - internalGetMutableAttributes().getMutableMap() - .clear(); - return this; - } - /** - * map<string, string> attributes = 8; - */ - - public Builder removeAttributes( - java.lang.String key) { - if (key == null) { throw new java.lang.NullPointerException(); } - internalGetMutableAttributes().getMutableMap() - .remove(key); - return this; - } - /** - * Use alternate mutation accessors instead. - */ - @java.lang.Deprecated - public java.util.Map - getMutableAttributes() { - return internalGetMutableAttributes().getMutableMap(); - } - /** - * map<string, string> attributes = 8; - */ - public Builder putAttributes( - java.lang.String key, - java.lang.String value) { - if (key == null) { throw new java.lang.NullPointerException(); } - if (value == null) { throw new java.lang.NullPointerException(); } - internalGetMutableAttributes().getMutableMap() - .put(key, value); - return this; - } - /** - * map<string, string> attributes = 8; - */ - - public Builder putAllAttributes( - java.util.Map values) { - internalGetMutableAttributes().getMutableMap() - .putAll(values); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:Action) - } - - // @@protoc_insertion_point(class_scope:Action) - private static final tech.donau.behaiv.proto.Action DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new tech.donau.behaiv.proto.Action(); - } - - public static tech.donau.behaiv.proto.Action getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Action parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Action(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public tech.donau.behaiv.proto.Action getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/src/main/java/tech/donau/behaiv/proto/ActionOrBuilder.java b/src/main/java/tech/donau/behaiv/proto/ActionOrBuilder.java deleted file mode 100644 index dfc71cf..0000000 --- a/src/main/java/tech/donau/behaiv/proto/ActionOrBuilder.java +++ /dev/null @@ -1,114 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: behaiv.proto - -package tech.donau.behaiv.proto; - -public interface ActionOrBuilder extends - // @@protoc_insertion_point(interface_extends:Action) - com.google.protobuf.MessageOrBuilder { - - /** - * int64 local_id = 1; - * @return The localId. - */ - long getLocalId(); - - /** - * int64 prev_local_id = 2; - * @return The prevLocalId. - */ - long getPrevLocalId(); - - /** - * string action = 3; - * @return The action. - */ - java.lang.String getAction(); - /** - * string action = 3; - * @return The bytes for action. - */ - com.google.protobuf.ByteString - getActionBytes(); - - /** - * string object = 4; - * @return The object. - */ - java.lang.String getObject(); - /** - * string object = 4; - * @return The bytes for object. - */ - com.google.protobuf.ByteString - getObjectBytes(); - - /** - * int32 current_screen_id = 5; - * @return The currentScreenId. - */ - int getCurrentScreenId(); - - /** - *
-   *    repeated Event events = 7; TODO
-   * 
- * - * repeated int32 screen_stack = 6; - * @return A list containing the screenStack. - */ - java.util.List getScreenStackList(); - /** - *
-   *    repeated Event events = 7; TODO
-   * 
- * - * repeated int32 screen_stack = 6; - * @return The count of screenStack. - */ - int getScreenStackCount(); - /** - *
-   *    repeated Event events = 7; TODO
-   * 
- * - * repeated int32 screen_stack = 6; - * @param index The index of the element to return. - * @return The screenStack at the given index. - */ - int getScreenStack(int index); - - /** - * map<string, string> attributes = 8; - */ - int getAttributesCount(); - /** - * map<string, string> attributes = 8; - */ - boolean containsAttributes( - java.lang.String key); - /** - * Use {@link #getAttributesMap()} instead. - */ - @java.lang.Deprecated - java.util.Map - getAttributes(); - /** - * map<string, string> attributes = 8; - */ - java.util.Map - getAttributesMap(); - /** - * map<string, string> attributes = 8; - */ - - java.lang.String getAttributesOrDefault( - java.lang.String key, - java.lang.String defaultValue); - /** - * map<string, string> attributes = 8; - */ - - java.lang.String getAttributesOrThrow( - java.lang.String key); -} diff --git a/src/main/java/tech/donau/behaiv/proto/Behaiv.java b/src/main/java/tech/donau/behaiv/proto/Behaiv.java deleted file mode 100644 index 7b718d0..0000000 --- a/src/main/java/tech/donau/behaiv/proto/Behaiv.java +++ /dev/null @@ -1,113 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: behaiv.proto - -package tech.donau.behaiv.proto; - -public final class Behaiv { - private Behaiv() {} - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistryLite registry) { - } - - public static void registerAllExtensions( - com.google.protobuf.ExtensionRegistry registry) { - registerAllExtensions( - (com.google.protobuf.ExtensionRegistryLite) registry); - } - static final com.google.protobuf.Descriptors.Descriptor - internal_static_Data_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_Data_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_Prediction_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_Prediction_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_PredictionSet_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_PredictionSet_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_Action_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_Action_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_Action_AttributesEntry_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_Action_AttributesEntry_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_Screen_descriptor; - static final - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_Screen_fieldAccessorTable; - - public static com.google.protobuf.Descriptors.FileDescriptor - getDescriptor() { - return descriptor; - } - private static com.google.protobuf.Descriptors.FileDescriptor - descriptor; - static { - java.lang.String[] descriptorData = { - "\n\014behaiv.proto\"(\n\004Data\022\013\n\003key\030\002 \001(\t\022\r\n\005v" + - "alue\030\003 \001(\001J\004\010\001\020\002\"0\n\nPrediction\022\023\n\004data\030\001" + - " \003(\0132\005.Data\022\r\n\005label\030\002 \001(\t\"H\n\rPrediction" + - "Set\022\037\n\nprediction\030\001 \003(\0132\013.Prediction\022\026\n\016" + - "dynamicColumns\030\002 \001(\010\"\342\001\n\006Action\022\020\n\010local" + - "_id\030\001 \001(\003\022\025\n\rprev_local_id\030\002 \001(\003\022\016\n\006acti" + - "on\030\003 \001(\t\022\016\n\006object\030\004 \001(\t\022\031\n\021current_scre" + - "en_id\030\005 \001(\005\022\024\n\014screen_stack\030\006 \003(\005\022+\n\natt" + - "ributes\030\010 \003(\0132\027.Action.AttributesEntry\0321" + - "\n\017AttributesEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030" + - "\002 \001(\t:\0028\001\"\"\n\006Screen\022\n\n\002id\030\001 \001(\005\022\014\n\004name\030" + - "\002 \001(\tB\033\n\027tech.donau.behaiv.protoP\001b\006prot" + - "o3" - }; - descriptor = com.google.protobuf.Descriptors.FileDescriptor - .internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - }); - internal_static_Data_descriptor = - getDescriptor().getMessageTypes().get(0); - internal_static_Data_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_Data_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_Prediction_descriptor = - getDescriptor().getMessageTypes().get(1); - internal_static_Prediction_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_Prediction_descriptor, - new java.lang.String[] { "Data", "Label", }); - internal_static_PredictionSet_descriptor = - getDescriptor().getMessageTypes().get(2); - internal_static_PredictionSet_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_PredictionSet_descriptor, - new java.lang.String[] { "Prediction", "DynamicColumns", }); - internal_static_Action_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_Action_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_Action_descriptor, - new java.lang.String[] { "LocalId", "PrevLocalId", "Action", "Object", "CurrentScreenId", "ScreenStack", "Attributes", }); - internal_static_Action_AttributesEntry_descriptor = - internal_static_Action_descriptor.getNestedTypes().get(0); - internal_static_Action_AttributesEntry_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_Action_AttributesEntry_descriptor, - new java.lang.String[] { "Key", "Value", }); - internal_static_Screen_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_Screen_fieldAccessorTable = new - com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_Screen_descriptor, - new java.lang.String[] { "Id", "Name", }); - } - - // @@protoc_insertion_point(outer_class_scope) -} diff --git a/src/main/java/tech/donau/behaiv/proto/Data.java b/src/main/java/tech/donau/behaiv/proto/Data.java deleted file mode 100644 index 39ddec0..0000000 --- a/src/main/java/tech/donau/behaiv/proto/Data.java +++ /dev/null @@ -1,627 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: behaiv.proto - -package tech.donau.behaiv.proto; - -/** - *
- * Data messages
- * 
- * - * Protobuf type {@code Data} - */ -public final class Data extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:Data) - DataOrBuilder { -private static final long serialVersionUID = 0L; - // Use Data.newBuilder() to construct. - private Data(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Data() { - key_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Data(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Data( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - key_ = s; - break; - } - case 25: { - - value_ = input.readDouble(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return tech.donau.behaiv.proto.Behaiv.internal_static_Data_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return tech.donau.behaiv.proto.Behaiv.internal_static_Data_fieldAccessorTable - .ensureFieldAccessorsInitialized( - tech.donau.behaiv.proto.Data.class, tech.donau.behaiv.proto.Data.Builder.class); - } - - public static final int KEY_FIELD_NUMBER = 2; - private volatile java.lang.Object key_; - /** - * string key = 2; - * @return The key. - */ - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } - } - /** - * string key = 2; - * @return The bytes for key. - */ - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - public static final int VALUE_FIELD_NUMBER = 3; - private double value_; - /** - * double value = 3; - * @return The value. - */ - public double getValue() { - return value_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (!getKeyBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, key_); - } - if (value_ != 0D) { - output.writeDouble(3, value_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getKeyBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, key_); - } - if (value_ != 0D) { - size += com.google.protobuf.CodedOutputStream - .computeDoubleSize(3, value_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof tech.donau.behaiv.proto.Data)) { - return super.equals(obj); - } - tech.donau.behaiv.proto.Data other = (tech.donau.behaiv.proto.Data) obj; - - if (!getKey() - .equals(other.getKey())) return false; - if (java.lang.Double.doubleToLongBits(getValue()) - != java.lang.Double.doubleToLongBits( - other.getValue())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + KEY_FIELD_NUMBER; - hash = (53 * hash) + getKey().hashCode(); - hash = (37 * hash) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong( - java.lang.Double.doubleToLongBits(getValue())); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static tech.donau.behaiv.proto.Data parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static tech.donau.behaiv.proto.Data parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static tech.donau.behaiv.proto.Data parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static tech.donau.behaiv.proto.Data parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static tech.donau.behaiv.proto.Data parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static tech.donau.behaiv.proto.Data parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static tech.donau.behaiv.proto.Data parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static tech.donau.behaiv.proto.Data parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static tech.donau.behaiv.proto.Data parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static tech.donau.behaiv.proto.Data parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static tech.donau.behaiv.proto.Data parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static tech.donau.behaiv.proto.Data parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(tech.donau.behaiv.proto.Data prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - *
-   * Data messages
-   * 
- * - * Protobuf type {@code Data} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:Data) - tech.donau.behaiv.proto.DataOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return tech.donau.behaiv.proto.Behaiv.internal_static_Data_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return tech.donau.behaiv.proto.Behaiv.internal_static_Data_fieldAccessorTable - .ensureFieldAccessorsInitialized( - tech.donau.behaiv.proto.Data.class, tech.donau.behaiv.proto.Data.Builder.class); - } - - // Construct using tech.donau.behaiv.proto.Data.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - key_ = ""; - - value_ = 0D; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return tech.donau.behaiv.proto.Behaiv.internal_static_Data_descriptor; - } - - @java.lang.Override - public tech.donau.behaiv.proto.Data getDefaultInstanceForType() { - return tech.donau.behaiv.proto.Data.getDefaultInstance(); - } - - @java.lang.Override - public tech.donau.behaiv.proto.Data build() { - tech.donau.behaiv.proto.Data result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public tech.donau.behaiv.proto.Data buildPartial() { - tech.donau.behaiv.proto.Data result = new tech.donau.behaiv.proto.Data(this); - result.key_ = key_; - result.value_ = value_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof tech.donau.behaiv.proto.Data) { - return mergeFrom((tech.donau.behaiv.proto.Data)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(tech.donau.behaiv.proto.Data other) { - if (other == tech.donau.behaiv.proto.Data.getDefaultInstance()) return this; - if (!other.getKey().isEmpty()) { - key_ = other.key_; - onChanged(); - } - if (other.getValue() != 0D) { - setValue(other.getValue()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - tech.donau.behaiv.proto.Data parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (tech.donau.behaiv.proto.Data) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private java.lang.Object key_ = ""; - /** - * string key = 2; - * @return The key. - */ - public java.lang.String getKey() { - java.lang.Object ref = key_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - key_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string key = 2; - * @return The bytes for key. - */ - public com.google.protobuf.ByteString - getKeyBytes() { - java.lang.Object ref = key_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - key_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string key = 2; - * @param value The key to set. - * @return This builder for chaining. - */ - public Builder setKey( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - key_ = value; - onChanged(); - return this; - } - /** - * string key = 2; - * @return This builder for chaining. - */ - public Builder clearKey() { - - key_ = getDefaultInstance().getKey(); - onChanged(); - return this; - } - /** - * string key = 2; - * @param value The bytes for key to set. - * @return This builder for chaining. - */ - public Builder setKeyBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - key_ = value; - onChanged(); - return this; - } - - private double value_ ; - /** - * double value = 3; - * @return The value. - */ - public double getValue() { - return value_; - } - /** - * double value = 3; - * @param value The value to set. - * @return This builder for chaining. - */ - public Builder setValue(double value) { - - value_ = value; - onChanged(); - return this; - } - /** - * double value = 3; - * @return This builder for chaining. - */ - public Builder clearValue() { - - value_ = 0D; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:Data) - } - - // @@protoc_insertion_point(class_scope:Data) - private static final tech.donau.behaiv.proto.Data DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new tech.donau.behaiv.proto.Data(); - } - - public static tech.donau.behaiv.proto.Data getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Data parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Data(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public tech.donau.behaiv.proto.Data getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/src/main/java/tech/donau/behaiv/proto/DataOrBuilder.java b/src/main/java/tech/donau/behaiv/proto/DataOrBuilder.java deleted file mode 100644 index f82daf4..0000000 --- a/src/main/java/tech/donau/behaiv/proto/DataOrBuilder.java +++ /dev/null @@ -1,27 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: behaiv.proto - -package tech.donau.behaiv.proto; - -public interface DataOrBuilder extends - // @@protoc_insertion_point(interface_extends:Data) - com.google.protobuf.MessageOrBuilder { - - /** - * string key = 2; - * @return The key. - */ - java.lang.String getKey(); - /** - * string key = 2; - * @return The bytes for key. - */ - com.google.protobuf.ByteString - getKeyBytes(); - - /** - * double value = 3; - * @return The value. - */ - double getValue(); -} diff --git a/src/main/java/tech/donau/behaiv/proto/Prediction.java b/src/main/java/tech/donau/behaiv/proto/Prediction.java deleted file mode 100644 index c7188c3..0000000 --- a/src/main/java/tech/donau/behaiv/proto/Prediction.java +++ /dev/null @@ -1,901 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: behaiv.proto - -package tech.donau.behaiv.proto; - -/** - * Protobuf type {@code Prediction} - */ -public final class Prediction extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:Prediction) - PredictionOrBuilder { -private static final long serialVersionUID = 0L; - // Use Prediction.newBuilder() to construct. - private Prediction(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Prediction() { - data_ = java.util.Collections.emptyList(); - label_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Prediction(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Prediction( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - data_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - data_.add( - input.readMessage(tech.donau.behaiv.proto.Data.parser(), extensionRegistry)); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - label_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - data_ = java.util.Collections.unmodifiableList(data_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return tech.donau.behaiv.proto.Behaiv.internal_static_Prediction_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return tech.donau.behaiv.proto.Behaiv.internal_static_Prediction_fieldAccessorTable - .ensureFieldAccessorsInitialized( - tech.donau.behaiv.proto.Prediction.class, tech.donau.behaiv.proto.Prediction.Builder.class); - } - - public static final int DATA_FIELD_NUMBER = 1; - private java.util.List data_; - /** - * repeated .Data data = 1; - */ - public java.util.List getDataList() { - return data_; - } - /** - * repeated .Data data = 1; - */ - public java.util.List - getDataOrBuilderList() { - return data_; - } - /** - * repeated .Data data = 1; - */ - public int getDataCount() { - return data_.size(); - } - /** - * repeated .Data data = 1; - */ - public tech.donau.behaiv.proto.Data getData(int index) { - return data_.get(index); - } - /** - * repeated .Data data = 1; - */ - public tech.donau.behaiv.proto.DataOrBuilder getDataOrBuilder( - int index) { - return data_.get(index); - } - - public static final int LABEL_FIELD_NUMBER = 2; - private volatile java.lang.Object label_; - /** - * string label = 2; - * @return The label. - */ - public java.lang.String getLabel() { - java.lang.Object ref = label_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - label_ = s; - return s; - } - } - /** - * string label = 2; - * @return The bytes for label. - */ - public com.google.protobuf.ByteString - getLabelBytes() { - java.lang.Object ref = label_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - label_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < data_.size(); i++) { - output.writeMessage(1, data_.get(i)); - } - if (!getLabelBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, label_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < data_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, data_.get(i)); - } - if (!getLabelBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, label_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof tech.donau.behaiv.proto.Prediction)) { - return super.equals(obj); - } - tech.donau.behaiv.proto.Prediction other = (tech.donau.behaiv.proto.Prediction) obj; - - if (!getDataList() - .equals(other.getDataList())) return false; - if (!getLabel() - .equals(other.getLabel())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getDataCount() > 0) { - hash = (37 * hash) + DATA_FIELD_NUMBER; - hash = (53 * hash) + getDataList().hashCode(); - } - hash = (37 * hash) + LABEL_FIELD_NUMBER; - hash = (53 * hash) + getLabel().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static tech.donau.behaiv.proto.Prediction parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static tech.donau.behaiv.proto.Prediction parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static tech.donau.behaiv.proto.Prediction parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static tech.donau.behaiv.proto.Prediction parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static tech.donau.behaiv.proto.Prediction parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static tech.donau.behaiv.proto.Prediction parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static tech.donau.behaiv.proto.Prediction parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static tech.donau.behaiv.proto.Prediction parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static tech.donau.behaiv.proto.Prediction parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static tech.donau.behaiv.proto.Prediction parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static tech.donau.behaiv.proto.Prediction parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static tech.donau.behaiv.proto.Prediction parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(tech.donau.behaiv.proto.Prediction prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code Prediction} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:Prediction) - tech.donau.behaiv.proto.PredictionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return tech.donau.behaiv.proto.Behaiv.internal_static_Prediction_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return tech.donau.behaiv.proto.Behaiv.internal_static_Prediction_fieldAccessorTable - .ensureFieldAccessorsInitialized( - tech.donau.behaiv.proto.Prediction.class, tech.donau.behaiv.proto.Prediction.Builder.class); - } - - // Construct using tech.donau.behaiv.proto.Prediction.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getDataFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (dataBuilder_ == null) { - data_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - dataBuilder_.clear(); - } - label_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return tech.donau.behaiv.proto.Behaiv.internal_static_Prediction_descriptor; - } - - @java.lang.Override - public tech.donau.behaiv.proto.Prediction getDefaultInstanceForType() { - return tech.donau.behaiv.proto.Prediction.getDefaultInstance(); - } - - @java.lang.Override - public tech.donau.behaiv.proto.Prediction build() { - tech.donau.behaiv.proto.Prediction result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public tech.donau.behaiv.proto.Prediction buildPartial() { - tech.donau.behaiv.proto.Prediction result = new tech.donau.behaiv.proto.Prediction(this); - int from_bitField0_ = bitField0_; - if (dataBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - data_ = java.util.Collections.unmodifiableList(data_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.data_ = data_; - } else { - result.data_ = dataBuilder_.build(); - } - result.label_ = label_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof tech.donau.behaiv.proto.Prediction) { - return mergeFrom((tech.donau.behaiv.proto.Prediction)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(tech.donau.behaiv.proto.Prediction other) { - if (other == tech.donau.behaiv.proto.Prediction.getDefaultInstance()) return this; - if (dataBuilder_ == null) { - if (!other.data_.isEmpty()) { - if (data_.isEmpty()) { - data_ = other.data_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureDataIsMutable(); - data_.addAll(other.data_); - } - onChanged(); - } - } else { - if (!other.data_.isEmpty()) { - if (dataBuilder_.isEmpty()) { - dataBuilder_.dispose(); - dataBuilder_ = null; - data_ = other.data_; - bitField0_ = (bitField0_ & ~0x00000001); - dataBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getDataFieldBuilder() : null; - } else { - dataBuilder_.addAllMessages(other.data_); - } - } - } - if (!other.getLabel().isEmpty()) { - label_ = other.label_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - tech.donau.behaiv.proto.Prediction parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (tech.donau.behaiv.proto.Prediction) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List data_ = - java.util.Collections.emptyList(); - private void ensureDataIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - data_ = new java.util.ArrayList(data_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - tech.donau.behaiv.proto.Data, tech.donau.behaiv.proto.Data.Builder, tech.donau.behaiv.proto.DataOrBuilder> dataBuilder_; - - /** - * repeated .Data data = 1; - */ - public java.util.List getDataList() { - if (dataBuilder_ == null) { - return java.util.Collections.unmodifiableList(data_); - } else { - return dataBuilder_.getMessageList(); - } - } - /** - * repeated .Data data = 1; - */ - public int getDataCount() { - if (dataBuilder_ == null) { - return data_.size(); - } else { - return dataBuilder_.getCount(); - } - } - /** - * repeated .Data data = 1; - */ - public tech.donau.behaiv.proto.Data getData(int index) { - if (dataBuilder_ == null) { - return data_.get(index); - } else { - return dataBuilder_.getMessage(index); - } - } - /** - * repeated .Data data = 1; - */ - public Builder setData( - int index, tech.donau.behaiv.proto.Data value) { - if (dataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDataIsMutable(); - data_.set(index, value); - onChanged(); - } else { - dataBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .Data data = 1; - */ - public Builder setData( - int index, tech.donau.behaiv.proto.Data.Builder builderForValue) { - if (dataBuilder_ == null) { - ensureDataIsMutable(); - data_.set(index, builderForValue.build()); - onChanged(); - } else { - dataBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .Data data = 1; - */ - public Builder addData(tech.donau.behaiv.proto.Data value) { - if (dataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDataIsMutable(); - data_.add(value); - onChanged(); - } else { - dataBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .Data data = 1; - */ - public Builder addData( - int index, tech.donau.behaiv.proto.Data value) { - if (dataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDataIsMutable(); - data_.add(index, value); - onChanged(); - } else { - dataBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .Data data = 1; - */ - public Builder addData( - tech.donau.behaiv.proto.Data.Builder builderForValue) { - if (dataBuilder_ == null) { - ensureDataIsMutable(); - data_.add(builderForValue.build()); - onChanged(); - } else { - dataBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .Data data = 1; - */ - public Builder addData( - int index, tech.donau.behaiv.proto.Data.Builder builderForValue) { - if (dataBuilder_ == null) { - ensureDataIsMutable(); - data_.add(index, builderForValue.build()); - onChanged(); - } else { - dataBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .Data data = 1; - */ - public Builder addAllData( - java.lang.Iterable values) { - if (dataBuilder_ == null) { - ensureDataIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, data_); - onChanged(); - } else { - dataBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .Data data = 1; - */ - public Builder clearData() { - if (dataBuilder_ == null) { - data_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - dataBuilder_.clear(); - } - return this; - } - /** - * repeated .Data data = 1; - */ - public Builder removeData(int index) { - if (dataBuilder_ == null) { - ensureDataIsMutable(); - data_.remove(index); - onChanged(); - } else { - dataBuilder_.remove(index); - } - return this; - } - /** - * repeated .Data data = 1; - */ - public tech.donau.behaiv.proto.Data.Builder getDataBuilder( - int index) { - return getDataFieldBuilder().getBuilder(index); - } - /** - * repeated .Data data = 1; - */ - public tech.donau.behaiv.proto.DataOrBuilder getDataOrBuilder( - int index) { - if (dataBuilder_ == null) { - return data_.get(index); } else { - return dataBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .Data data = 1; - */ - public java.util.List - getDataOrBuilderList() { - if (dataBuilder_ != null) { - return dataBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(data_); - } - } - /** - * repeated .Data data = 1; - */ - public tech.donau.behaiv.proto.Data.Builder addDataBuilder() { - return getDataFieldBuilder().addBuilder( - tech.donau.behaiv.proto.Data.getDefaultInstance()); - } - /** - * repeated .Data data = 1; - */ - public tech.donau.behaiv.proto.Data.Builder addDataBuilder( - int index) { - return getDataFieldBuilder().addBuilder( - index, tech.donau.behaiv.proto.Data.getDefaultInstance()); - } - /** - * repeated .Data data = 1; - */ - public java.util.List - getDataBuilderList() { - return getDataFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - tech.donau.behaiv.proto.Data, tech.donau.behaiv.proto.Data.Builder, tech.donau.behaiv.proto.DataOrBuilder> - getDataFieldBuilder() { - if (dataBuilder_ == null) { - dataBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - tech.donau.behaiv.proto.Data, tech.donau.behaiv.proto.Data.Builder, tech.donau.behaiv.proto.DataOrBuilder>( - data_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - data_ = null; - } - return dataBuilder_; - } - - private java.lang.Object label_ = ""; - /** - * string label = 2; - * @return The label. - */ - public java.lang.String getLabel() { - java.lang.Object ref = label_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - label_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string label = 2; - * @return The bytes for label. - */ - public com.google.protobuf.ByteString - getLabelBytes() { - java.lang.Object ref = label_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - label_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string label = 2; - * @param value The label to set. - * @return This builder for chaining. - */ - public Builder setLabel( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - label_ = value; - onChanged(); - return this; - } - /** - * string label = 2; - * @return This builder for chaining. - */ - public Builder clearLabel() { - - label_ = getDefaultInstance().getLabel(); - onChanged(); - return this; - } - /** - * string label = 2; - * @param value The bytes for label to set. - * @return This builder for chaining. - */ - public Builder setLabelBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - label_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:Prediction) - } - - // @@protoc_insertion_point(class_scope:Prediction) - private static final tech.donau.behaiv.proto.Prediction DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new tech.donau.behaiv.proto.Prediction(); - } - - public static tech.donau.behaiv.proto.Prediction getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Prediction parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Prediction(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public tech.donau.behaiv.proto.Prediction getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/src/main/java/tech/donau/behaiv/proto/PredictionOrBuilder.java b/src/main/java/tech/donau/behaiv/proto/PredictionOrBuilder.java deleted file mode 100644 index 740e6ae..0000000 --- a/src/main/java/tech/donau/behaiv/proto/PredictionOrBuilder.java +++ /dev/null @@ -1,45 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: behaiv.proto - -package tech.donau.behaiv.proto; - -public interface PredictionOrBuilder extends - // @@protoc_insertion_point(interface_extends:Prediction) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .Data data = 1; - */ - java.util.List - getDataList(); - /** - * repeated .Data data = 1; - */ - tech.donau.behaiv.proto.Data getData(int index); - /** - * repeated .Data data = 1; - */ - int getDataCount(); - /** - * repeated .Data data = 1; - */ - java.util.List - getDataOrBuilderList(); - /** - * repeated .Data data = 1; - */ - tech.donau.behaiv.proto.DataOrBuilder getDataOrBuilder( - int index); - - /** - * string label = 2; - * @return The label. - */ - java.lang.String getLabel(); - /** - * string label = 2; - * @return The bytes for label. - */ - com.google.protobuf.ByteString - getLabelBytes(); -} diff --git a/src/main/java/tech/donau/behaiv/proto/PredictionSet.java b/src/main/java/tech/donau/behaiv/proto/PredictionSet.java deleted file mode 100644 index 6e11bf1..0000000 --- a/src/main/java/tech/donau/behaiv/proto/PredictionSet.java +++ /dev/null @@ -1,828 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: behaiv.proto - -package tech.donau.behaiv.proto; - -/** - * Protobuf type {@code PredictionSet} - */ -public final class PredictionSet extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:PredictionSet) - PredictionSetOrBuilder { -private static final long serialVersionUID = 0L; - // Use PredictionSet.newBuilder() to construct. - private PredictionSet(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private PredictionSet() { - prediction_ = java.util.Collections.emptyList(); - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new PredictionSet(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private PredictionSet( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - int mutable_bitField0_ = 0; - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - prediction_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - prediction_.add( - input.readMessage(tech.donau.behaiv.proto.Prediction.parser(), extensionRegistry)); - break; - } - case 16: { - - dynamicColumns_ = input.readBool(); - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) != 0)) { - prediction_ = java.util.Collections.unmodifiableList(prediction_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return tech.donau.behaiv.proto.Behaiv.internal_static_PredictionSet_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return tech.donau.behaiv.proto.Behaiv.internal_static_PredictionSet_fieldAccessorTable - .ensureFieldAccessorsInitialized( - tech.donau.behaiv.proto.PredictionSet.class, tech.donau.behaiv.proto.PredictionSet.Builder.class); - } - - public static final int PREDICTION_FIELD_NUMBER = 1; - private java.util.List prediction_; - /** - * repeated .Prediction prediction = 1; - */ - public java.util.List getPredictionList() { - return prediction_; - } - /** - * repeated .Prediction prediction = 1; - */ - public java.util.List - getPredictionOrBuilderList() { - return prediction_; - } - /** - * repeated .Prediction prediction = 1; - */ - public int getPredictionCount() { - return prediction_.size(); - } - /** - * repeated .Prediction prediction = 1; - */ - public tech.donau.behaiv.proto.Prediction getPrediction(int index) { - return prediction_.get(index); - } - /** - * repeated .Prediction prediction = 1; - */ - public tech.donau.behaiv.proto.PredictionOrBuilder getPredictionOrBuilder( - int index) { - return prediction_.get(index); - } - - public static final int DYNAMICCOLUMNS_FIELD_NUMBER = 2; - private boolean dynamicColumns_; - /** - * bool dynamicColumns = 2; - * @return The dynamicColumns. - */ - public boolean getDynamicColumns() { - return dynamicColumns_; - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - for (int i = 0; i < prediction_.size(); i++) { - output.writeMessage(1, prediction_.get(i)); - } - if (dynamicColumns_ != false) { - output.writeBool(2, dynamicColumns_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < prediction_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, prediction_.get(i)); - } - if (dynamicColumns_ != false) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(2, dynamicColumns_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof tech.donau.behaiv.proto.PredictionSet)) { - return super.equals(obj); - } - tech.donau.behaiv.proto.PredictionSet other = (tech.donau.behaiv.proto.PredictionSet) obj; - - if (!getPredictionList() - .equals(other.getPredictionList())) return false; - if (getDynamicColumns() - != other.getDynamicColumns()) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getPredictionCount() > 0) { - hash = (37 * hash) + PREDICTION_FIELD_NUMBER; - hash = (53 * hash) + getPredictionList().hashCode(); - } - hash = (37 * hash) + DYNAMICCOLUMNS_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getDynamicColumns()); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static tech.donau.behaiv.proto.PredictionSet parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static tech.donau.behaiv.proto.PredictionSet parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static tech.donau.behaiv.proto.PredictionSet parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static tech.donau.behaiv.proto.PredictionSet parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static tech.donau.behaiv.proto.PredictionSet parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static tech.donau.behaiv.proto.PredictionSet parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static tech.donau.behaiv.proto.PredictionSet parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static tech.donau.behaiv.proto.PredictionSet parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static tech.donau.behaiv.proto.PredictionSet parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static tech.donau.behaiv.proto.PredictionSet parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static tech.donau.behaiv.proto.PredictionSet parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static tech.donau.behaiv.proto.PredictionSet parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(tech.donau.behaiv.proto.PredictionSet prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code PredictionSet} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:PredictionSet) - tech.donau.behaiv.proto.PredictionSetOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return tech.donau.behaiv.proto.Behaiv.internal_static_PredictionSet_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return tech.donau.behaiv.proto.Behaiv.internal_static_PredictionSet_fieldAccessorTable - .ensureFieldAccessorsInitialized( - tech.donau.behaiv.proto.PredictionSet.class, tech.donau.behaiv.proto.PredictionSet.Builder.class); - } - - // Construct using tech.donau.behaiv.proto.PredictionSet.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - getPredictionFieldBuilder(); - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - if (predictionBuilder_ == null) { - prediction_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - predictionBuilder_.clear(); - } - dynamicColumns_ = false; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return tech.donau.behaiv.proto.Behaiv.internal_static_PredictionSet_descriptor; - } - - @java.lang.Override - public tech.donau.behaiv.proto.PredictionSet getDefaultInstanceForType() { - return tech.donau.behaiv.proto.PredictionSet.getDefaultInstance(); - } - - @java.lang.Override - public tech.donau.behaiv.proto.PredictionSet build() { - tech.donau.behaiv.proto.PredictionSet result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public tech.donau.behaiv.proto.PredictionSet buildPartial() { - tech.donau.behaiv.proto.PredictionSet result = new tech.donau.behaiv.proto.PredictionSet(this); - int from_bitField0_ = bitField0_; - if (predictionBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - prediction_ = java.util.Collections.unmodifiableList(prediction_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.prediction_ = prediction_; - } else { - result.prediction_ = predictionBuilder_.build(); - } - result.dynamicColumns_ = dynamicColumns_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof tech.donau.behaiv.proto.PredictionSet) { - return mergeFrom((tech.donau.behaiv.proto.PredictionSet)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(tech.donau.behaiv.proto.PredictionSet other) { - if (other == tech.donau.behaiv.proto.PredictionSet.getDefaultInstance()) return this; - if (predictionBuilder_ == null) { - if (!other.prediction_.isEmpty()) { - if (prediction_.isEmpty()) { - prediction_ = other.prediction_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensurePredictionIsMutable(); - prediction_.addAll(other.prediction_); - } - onChanged(); - } - } else { - if (!other.prediction_.isEmpty()) { - if (predictionBuilder_.isEmpty()) { - predictionBuilder_.dispose(); - predictionBuilder_ = null; - prediction_ = other.prediction_; - bitField0_ = (bitField0_ & ~0x00000001); - predictionBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? - getPredictionFieldBuilder() : null; - } else { - predictionBuilder_.addAllMessages(other.prediction_); - } - } - } - if (other.getDynamicColumns() != false) { - setDynamicColumns(other.getDynamicColumns()); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - tech.donau.behaiv.proto.PredictionSet parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (tech.donau.behaiv.proto.PredictionSet) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - private int bitField0_; - - private java.util.List prediction_ = - java.util.Collections.emptyList(); - private void ensurePredictionIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - prediction_ = new java.util.ArrayList(prediction_); - bitField0_ |= 0x00000001; - } - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - tech.donau.behaiv.proto.Prediction, tech.donau.behaiv.proto.Prediction.Builder, tech.donau.behaiv.proto.PredictionOrBuilder> predictionBuilder_; - - /** - * repeated .Prediction prediction = 1; - */ - public java.util.List getPredictionList() { - if (predictionBuilder_ == null) { - return java.util.Collections.unmodifiableList(prediction_); - } else { - return predictionBuilder_.getMessageList(); - } - } - /** - * repeated .Prediction prediction = 1; - */ - public int getPredictionCount() { - if (predictionBuilder_ == null) { - return prediction_.size(); - } else { - return predictionBuilder_.getCount(); - } - } - /** - * repeated .Prediction prediction = 1; - */ - public tech.donau.behaiv.proto.Prediction getPrediction(int index) { - if (predictionBuilder_ == null) { - return prediction_.get(index); - } else { - return predictionBuilder_.getMessage(index); - } - } - /** - * repeated .Prediction prediction = 1; - */ - public Builder setPrediction( - int index, tech.donau.behaiv.proto.Prediction value) { - if (predictionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePredictionIsMutable(); - prediction_.set(index, value); - onChanged(); - } else { - predictionBuilder_.setMessage(index, value); - } - return this; - } - /** - * repeated .Prediction prediction = 1; - */ - public Builder setPrediction( - int index, tech.donau.behaiv.proto.Prediction.Builder builderForValue) { - if (predictionBuilder_ == null) { - ensurePredictionIsMutable(); - prediction_.set(index, builderForValue.build()); - onChanged(); - } else { - predictionBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .Prediction prediction = 1; - */ - public Builder addPrediction(tech.donau.behaiv.proto.Prediction value) { - if (predictionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePredictionIsMutable(); - prediction_.add(value); - onChanged(); - } else { - predictionBuilder_.addMessage(value); - } - return this; - } - /** - * repeated .Prediction prediction = 1; - */ - public Builder addPrediction( - int index, tech.donau.behaiv.proto.Prediction value) { - if (predictionBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePredictionIsMutable(); - prediction_.add(index, value); - onChanged(); - } else { - predictionBuilder_.addMessage(index, value); - } - return this; - } - /** - * repeated .Prediction prediction = 1; - */ - public Builder addPrediction( - tech.donau.behaiv.proto.Prediction.Builder builderForValue) { - if (predictionBuilder_ == null) { - ensurePredictionIsMutable(); - prediction_.add(builderForValue.build()); - onChanged(); - } else { - predictionBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * repeated .Prediction prediction = 1; - */ - public Builder addPrediction( - int index, tech.donau.behaiv.proto.Prediction.Builder builderForValue) { - if (predictionBuilder_ == null) { - ensurePredictionIsMutable(); - prediction_.add(index, builderForValue.build()); - onChanged(); - } else { - predictionBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * repeated .Prediction prediction = 1; - */ - public Builder addAllPrediction( - java.lang.Iterable values) { - if (predictionBuilder_ == null) { - ensurePredictionIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll( - values, prediction_); - onChanged(); - } else { - predictionBuilder_.addAllMessages(values); - } - return this; - } - /** - * repeated .Prediction prediction = 1; - */ - public Builder clearPrediction() { - if (predictionBuilder_ == null) { - prediction_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - predictionBuilder_.clear(); - } - return this; - } - /** - * repeated .Prediction prediction = 1; - */ - public Builder removePrediction(int index) { - if (predictionBuilder_ == null) { - ensurePredictionIsMutable(); - prediction_.remove(index); - onChanged(); - } else { - predictionBuilder_.remove(index); - } - return this; - } - /** - * repeated .Prediction prediction = 1; - */ - public tech.donau.behaiv.proto.Prediction.Builder getPredictionBuilder( - int index) { - return getPredictionFieldBuilder().getBuilder(index); - } - /** - * repeated .Prediction prediction = 1; - */ - public tech.donau.behaiv.proto.PredictionOrBuilder getPredictionOrBuilder( - int index) { - if (predictionBuilder_ == null) { - return prediction_.get(index); } else { - return predictionBuilder_.getMessageOrBuilder(index); - } - } - /** - * repeated .Prediction prediction = 1; - */ - public java.util.List - getPredictionOrBuilderList() { - if (predictionBuilder_ != null) { - return predictionBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(prediction_); - } - } - /** - * repeated .Prediction prediction = 1; - */ - public tech.donau.behaiv.proto.Prediction.Builder addPredictionBuilder() { - return getPredictionFieldBuilder().addBuilder( - tech.donau.behaiv.proto.Prediction.getDefaultInstance()); - } - /** - * repeated .Prediction prediction = 1; - */ - public tech.donau.behaiv.proto.Prediction.Builder addPredictionBuilder( - int index) { - return getPredictionFieldBuilder().addBuilder( - index, tech.donau.behaiv.proto.Prediction.getDefaultInstance()); - } - /** - * repeated .Prediction prediction = 1; - */ - public java.util.List - getPredictionBuilderList() { - return getPredictionFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilderV3< - tech.donau.behaiv.proto.Prediction, tech.donau.behaiv.proto.Prediction.Builder, tech.donau.behaiv.proto.PredictionOrBuilder> - getPredictionFieldBuilder() { - if (predictionBuilder_ == null) { - predictionBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< - tech.donau.behaiv.proto.Prediction, tech.donau.behaiv.proto.Prediction.Builder, tech.donau.behaiv.proto.PredictionOrBuilder>( - prediction_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - prediction_ = null; - } - return predictionBuilder_; - } - - private boolean dynamicColumns_ ; - /** - * bool dynamicColumns = 2; - * @return The dynamicColumns. - */ - public boolean getDynamicColumns() { - return dynamicColumns_; - } - /** - * bool dynamicColumns = 2; - * @param value The dynamicColumns to set. - * @return This builder for chaining. - */ - public Builder setDynamicColumns(boolean value) { - - dynamicColumns_ = value; - onChanged(); - return this; - } - /** - * bool dynamicColumns = 2; - * @return This builder for chaining. - */ - public Builder clearDynamicColumns() { - - dynamicColumns_ = false; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:PredictionSet) - } - - // @@protoc_insertion_point(class_scope:PredictionSet) - private static final tech.donau.behaiv.proto.PredictionSet DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new tech.donau.behaiv.proto.PredictionSet(); - } - - public static tech.donau.behaiv.proto.PredictionSet getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public PredictionSet parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new PredictionSet(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public tech.donau.behaiv.proto.PredictionSet getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/src/main/java/tech/donau/behaiv/proto/PredictionSetOrBuilder.java b/src/main/java/tech/donau/behaiv/proto/PredictionSetOrBuilder.java deleted file mode 100644 index 745e30e..0000000 --- a/src/main/java/tech/donau/behaiv/proto/PredictionSetOrBuilder.java +++ /dev/null @@ -1,39 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: behaiv.proto - -package tech.donau.behaiv.proto; - -public interface PredictionSetOrBuilder extends - // @@protoc_insertion_point(interface_extends:PredictionSet) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .Prediction prediction = 1; - */ - java.util.List - getPredictionList(); - /** - * repeated .Prediction prediction = 1; - */ - tech.donau.behaiv.proto.Prediction getPrediction(int index); - /** - * repeated .Prediction prediction = 1; - */ - int getPredictionCount(); - /** - * repeated .Prediction prediction = 1; - */ - java.util.List - getPredictionOrBuilderList(); - /** - * repeated .Prediction prediction = 1; - */ - tech.donau.behaiv.proto.PredictionOrBuilder getPredictionOrBuilder( - int index); - - /** - * bool dynamicColumns = 2; - * @return The dynamicColumns. - */ - boolean getDynamicColumns(); -} diff --git a/src/main/java/tech/donau/behaiv/proto/Screen.java b/src/main/java/tech/donau/behaiv/proto/Screen.java deleted file mode 100644 index 0c80fe3..0000000 --- a/src/main/java/tech/donau/behaiv/proto/Screen.java +++ /dev/null @@ -1,617 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: behaiv.proto - -package tech.donau.behaiv.proto; - -/** - * Protobuf type {@code Screen} - */ -public final class Screen extends - com.google.protobuf.GeneratedMessageV3 implements - // @@protoc_insertion_point(message_implements:Screen) - ScreenOrBuilder { -private static final long serialVersionUID = 0L; - // Use Screen.newBuilder() to construct. - private Screen(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } - private Screen() { - name_ = ""; - } - - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance( - UnusedPrivateParameter unused) { - return new Screen(); - } - - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet - getUnknownFields() { - return this.unknownFields; - } - private Screen( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder(); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - - id_ = input.readInt32(); - break; - } - case 18: { - java.lang.String s = input.readStringRequireUtf8(); - - name_ = s; - break; - } - default: { - if (!parseUnknownField( - input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } - } - } - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException( - e).setUnfinishedMessage(this); - } finally { - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return tech.donau.behaiv.proto.Behaiv.internal_static_Screen_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return tech.donau.behaiv.proto.Behaiv.internal_static_Screen_fieldAccessorTable - .ensureFieldAccessorsInitialized( - tech.donau.behaiv.proto.Screen.class, tech.donau.behaiv.proto.Screen.Builder.class); - } - - public static final int ID_FIELD_NUMBER = 1; - private int id_; - /** - * int32 id = 1; - * @return The id. - */ - public int getId() { - return id_; - } - - public static final int NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object name_; - /** - * string name = 2; - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } - } - /** - * string name = 2; - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private byte memoizedIsInitialized = -1; - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - memoizedIsInitialized = 1; - return true; - } - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - if (id_ != 0) { - output.writeInt32(1, id_); - } - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); - } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (id_ != 0) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, id_); - } - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); - } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof tech.donau.behaiv.proto.Screen)) { - return super.equals(obj); - } - tech.donau.behaiv.proto.Screen other = (tech.donau.behaiv.proto.Screen) obj; - - if (getId() - != other.getId()) return false; - if (!getName() - .equals(other.getName())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ID_FIELD_NUMBER; - hash = (53 * hash) + getId(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static tech.donau.behaiv.proto.Screen parseFrom( - java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static tech.donau.behaiv.proto.Screen parseFrom( - java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static tech.donau.behaiv.proto.Screen parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static tech.donau.behaiv.proto.Screen parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static tech.donau.behaiv.proto.Screen parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - public static tech.donau.behaiv.proto.Screen parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - public static tech.donau.behaiv.proto.Screen parseFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static tech.donau.behaiv.proto.Screen parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - public static tech.donau.behaiv.proto.Screen parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input); - } - public static tech.donau.behaiv.proto.Screen parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - public static tech.donau.behaiv.proto.Screen parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input); - } - public static tech.donau.behaiv.proto.Screen parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3 - .parseWithIOException(PARSER, input, extensionRegistry); - } - - @java.lang.Override - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder() { - return DEFAULT_INSTANCE.toBuilder(); - } - public static Builder newBuilder(tech.donau.behaiv.proto.Screen prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE - ? new Builder() : new Builder().mergeFrom(this); - } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * Protobuf type {@code Screen} - */ - public static final class Builder extends - com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(builder_implements:Screen) - tech.donau.behaiv.proto.ScreenOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return tech.donau.behaiv.proto.Behaiv.internal_static_Screen_descriptor; - } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return tech.donau.behaiv.proto.Behaiv.internal_static_Screen_fieldAccessorTable - .ensureFieldAccessorsInitialized( - tech.donau.behaiv.proto.Screen.class, tech.donau.behaiv.proto.Screen.Builder.class); - } - - // Construct using tech.donau.behaiv.proto.Screen.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3 - .alwaysUseFieldBuilders) { - } - } - @java.lang.Override - public Builder clear() { - super.clear(); - id_ = 0; - - name_ = ""; - - return this; - } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return tech.donau.behaiv.proto.Behaiv.internal_static_Screen_descriptor; - } - - @java.lang.Override - public tech.donau.behaiv.proto.Screen getDefaultInstanceForType() { - return tech.donau.behaiv.proto.Screen.getDefaultInstance(); - } - - @java.lang.Override - public tech.donau.behaiv.proto.Screen build() { - tech.donau.behaiv.proto.Screen result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - @java.lang.Override - public tech.donau.behaiv.proto.Screen buildPartial() { - tech.donau.behaiv.proto.Screen result = new tech.donau.behaiv.proto.Screen(this); - result.id_ = id_; - result.name_ = name_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.setField(field, value); - } - @java.lang.Override - public Builder clearField( - com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } - @java.lang.Override - public Builder clearOneof( - com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - java.lang.Object value) { - return super.addRepeatedField(field, value); - } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof tech.donau.behaiv.proto.Screen) { - return mergeFrom((tech.donau.behaiv.proto.Screen)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(tech.donau.behaiv.proto.Screen other) { - if (other == tech.donau.behaiv.proto.Screen.getDefaultInstance()) return this; - if (other.getId() != 0) { - setId(other.getId()); - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } - - @java.lang.Override - public final boolean isInitialized() { - return true; - } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - tech.donau.behaiv.proto.Screen parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (tech.donau.behaiv.proto.Screen) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private int id_ ; - /** - * int32 id = 1; - * @return The id. - */ - public int getId() { - return id_; - } - /** - * int32 id = 1; - * @param value The id to set. - * @return This builder for chaining. - */ - public Builder setId(int value) { - - id_ = value; - onChanged(); - return this; - } - /** - * int32 id = 1; - * @return This builder for chaining. - */ - public Builder clearId() { - - id_ = 0; - onChanged(); - return this; - } - - private java.lang.Object name_ = ""; - /** - * string name = 2; - * @return The name. - */ - public java.lang.String getName() { - java.lang.Object ref = name_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - name_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * string name = 2; - * @return The bytes for name. - */ - public com.google.protobuf.ByteString - getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - name_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * string name = 2; - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - name_ = value; - onChanged(); - return this; - } - /** - * string name = 2; - * @return This builder for chaining. - */ - public Builder clearName() { - - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * string name = 2; - * @param value The bytes for name to set. - * @return This builder for chaining. - */ - public Builder setNameBytes( - com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - name_ = value; - onChanged(); - return this; - } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } - - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); - } - - - // @@protoc_insertion_point(builder_scope:Screen) - } - - // @@protoc_insertion_point(class_scope:Screen) - private static final tech.donau.behaiv.proto.Screen DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new tech.donau.behaiv.proto.Screen(); - } - - public static tech.donau.behaiv.proto.Screen getDefaultInstance() { - return DEFAULT_INSTANCE; - } - - private static final com.google.protobuf.Parser - PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Screen parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new Screen(input, extensionRegistry); - } - }; - - public static com.google.protobuf.Parser parser() { - return PARSER; - } - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } - - @java.lang.Override - public tech.donau.behaiv.proto.Screen getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } - -} - diff --git a/src/main/java/tech/donau/behaiv/proto/ScreenOrBuilder.java b/src/main/java/tech/donau/behaiv/proto/ScreenOrBuilder.java deleted file mode 100644 index e258da2..0000000 --- a/src/main/java/tech/donau/behaiv/proto/ScreenOrBuilder.java +++ /dev/null @@ -1,27 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: behaiv.proto - -package tech.donau.behaiv.proto; - -public interface ScreenOrBuilder extends - // @@protoc_insertion_point(interface_extends:Screen) - com.google.protobuf.MessageOrBuilder { - - /** - * int32 id = 1; - * @return The id. - */ - int getId(); - - /** - * string name = 2; - * @return The name. - */ - java.lang.String getName(); - /** - * string name = 2; - * @return The bytes for name. - */ - com.google.protobuf.ByteString - getNameBytes(); -} diff --git a/src/test/java/de/dmi3y/behaiv/BehaivTest.java b/src/test/java/de/dmi3y/behaiv/BehaivTest.java index 354eea4..9c9091b 100644 --- a/src/test/java/de/dmi3y/behaiv/BehaivTest.java +++ b/src/test/java/de/dmi3y/behaiv/BehaivTest.java @@ -1,6 +1,5 @@ package de.dmi3y.behaiv; -import de.dmi3y.behaiv.kernel.BaseKernel; import de.dmi3y.behaiv.kernel.Kernel; import de.dmi3y.behaiv.kernel.LogisticRegressionKernel; import de.dmi3y.behaiv.provider.DayTimeProvider; @@ -60,7 +59,7 @@ public void stopCapturing_whenDiscard_sessionShouldBeNull() { @Test public void startCapturing_tryToRestore_restoreNetwork() throws IOException { - final Kernel mockKernel = mock(BaseKernel.class); + final Kernel mockKernel = mock(Kernel.class); final BehaivStorage storage = mock(BehaivStorage.class); final Behaiv behaiv = new Behaiv.Builder("testId") .setKernel(mockKernel) @@ -76,7 +75,7 @@ public void startCapturing_tryToRestore_restoreNetwork() throws IOException { @Test public void startCapturing_withIOException_continueWithoutSaving() throws IOException { - final Kernel testKernel = mock(BaseKernel.class); + final Kernel testKernel = mock(Kernel.class); final BehaivStorage storage = mock(BehaivStorage.class); final Behaiv behaiv = Behaiv.with("testId") .setKernel(testKernel) diff --git a/src/test/java/de/dmi3y/behaiv/kernel/KernelTest.java b/src/test/java/de/dmi3y/behaiv/kernel/KernelTest.java index cf1d1bd..78cde5f 100644 --- a/src/test/java/de/dmi3y/behaiv/kernel/KernelTest.java +++ b/src/test/java/de/dmi3y/behaiv/kernel/KernelTest.java @@ -6,8 +6,6 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; -import tech.donau.behaiv.proto.Data; -import tech.donau.behaiv.proto.Prediction; import java.io.File; import java.io.IOException; @@ -42,12 +40,8 @@ public void setUp() throws Exception { @Test public void setTreshold() { dummyKernel.setTreshold(1L); - final Prediction prediction = Prediction.newBuilder().addData( - Data.newBuilder().setKey("null").setValue(0.0D).build() - ).addData( - Data.newBuilder().setKey("null2").setValue(0.0D).build()).build(); - dummyKernel.data = dummyKernel.data.toBuilder() - .addPrediction(prediction).addPrediction(prediction).build(); + dummyKernel.data.add(new Pair, String>(null, null)); + dummyKernel.data.add(new Pair, String>(null, null)); boolean readyToPredict = dummyKernel.readyToPredict(); assertTrue(readyToPredict); dummyKernel.setTreshold(10L); diff --git a/src/test/java/de/dmi3y/behaiv/kernel/LogisticRegressionKernelTest.java b/src/test/java/de/dmi3y/behaiv/kernel/LogisticRegressionKernelTest.java index 2157575..1a6fdf4 100644 --- a/src/test/java/de/dmi3y/behaiv/kernel/LogisticRegressionKernelTest.java +++ b/src/test/java/de/dmi3y/behaiv/kernel/LogisticRegressionKernelTest.java @@ -1,7 +1,6 @@ package de.dmi3y.behaiv.kernel; import de.dmi3y.behaiv.storage.SimpleStorage; -import de.dmi3y.behaiv.tools.DataMappingUtils; import de.dmi3y.behaiv.tools.Pair; import org.junit.Before; import org.junit.Rule; @@ -16,6 +15,7 @@ import static de.dmi3y.behaiv.kernel.KernelTest.HOME; import static de.dmi3y.behaiv.kernel.KernelTest.WORK; +import static de.dmi3y.behaiv.kernel.KernelTest.getTrainingData; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -57,12 +57,6 @@ public void predictOne() { assertEquals("SELFIMPROVEMENT_SCREEN", prediction); } - @Test - public void isPartialFitAllowed_inLogisticRegression_shouldReturnFalse() { - final Kernel kernel = new LogisticRegressionKernel("testId"); - assertFalse(kernel.isPartialFitAllowed()); - } - @Test public void storeResults() throws IOException, ClassNotFoundException { List, String>> data = KernelTest.getTrainingData(); @@ -151,8 +145,8 @@ public void storeResults_saveWhenDataIsNull_expectException() throws IOException public void storeResults_saveDataAndThenTheta_expectNormalFlow() throws IOException, ClassNotFoundException { List, String>> data = KernelTest.getTrainingData(); LogisticRegressionKernel kernel = new LogisticRegressionKernel("storeTest", new Random()); - kernel.data = DataMappingUtils.createPredictionSet(data); - kernel.cachedLables = Arrays.asList("time", "lat", "lon", "headphones"); + kernel.data = data; + kernel.labels = Arrays.asList("time", "lat", "lon", "headphones"); //Omit fit // kernel.fit(data); ArrayList predictList = new ArrayList<>(); @@ -167,7 +161,8 @@ public void storeResults_saveDataAndThenTheta_expectNormalFlow() throws IOExcept kernel = new LogisticRegressionKernel("storeTest"); kernel.restore(storage); - assertFalse(kernel.data.getPredictionList().isEmpty()); + assertFalse(kernel.data.isEmpty()); + kernel.data.get(0).getKey(); kernel.fit(data); String prediction = kernel.predictOne(predictList); diff --git a/src/test/java/de/dmi3y/behaiv/tools/DataMappingUtilsTest.java b/src/test/java/de/dmi3y/behaiv/tools/DataMappingUtilsTest.java index 3468804..09e218e 100644 --- a/src/test/java/de/dmi3y/behaiv/tools/DataMappingUtilsTest.java +++ b/src/test/java/de/dmi3y/behaiv/tools/DataMappingUtilsTest.java @@ -1,36 +1,18 @@ package de.dmi3y.behaiv.tools; import org.junit.Test; -import tech.donau.behaiv.proto.Prediction; -import tech.donau.behaiv.proto.PredictionSet; +import org.mockito.internal.matchers.Null; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; -import static org.hamcrest.CoreMatchers.hasItem; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.notNullValue; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.hamcrest.CoreMatchers.*; +import static org.junit.Assert.*; public class DataMappingUtilsTest { - - @Test - public void createPredictionSet_feedDefaultTestData_expectCorrectOrder() { - final Pair, String> mockData = getMockPairListDoubleStringData(); - final PredictionSet predictionSet = DataMappingUtils.createPredictionSet(Collections.singletonList(mockData)); - assertEquals(1, predictionSet.getPredictionCount()); - final Prediction prediction = predictionSet.getPrediction(0); - assertEquals("Potato", prediction.getLabel()); - assertEquals(1, prediction.getDataCount()); - assertEquals("key0", prediction.getData(0).getKey()); - assertEquals(20d, prediction.getData(0).getValue(), 0); - } - @Test public void toDistinctListOfPairValues_withInputData_returnsExpectedDistinctListOfPairValues() { List, String>> mockData = Arrays.asList( @@ -91,7 +73,7 @@ public void toInput2dArray_withEmptyListOfInputData_returnsEmpty2dArray() { @Test(expected = NullPointerException.class) public void toInput2dArray_withNull_throwsNullPointerException() { - DataMappingUtils.toInput2dArray((List, String>>) null); + DataMappingUtils.toInput2dArray(null); }