diff --git a/pom.xml b/pom.xml index a549cdc..adf7d60 100644 --- a/pom.xml +++ b/pom.xml @@ -1,152 +1,161 @@ - 4.0.0 - io.keyko.monitoring - keyko-event-streamer - 0.0.1 - 2019 - - 2.4.0 - 1.4.0 - UTF-8 + 4.0.0 + io.keyko.monitoring + keyko-event-streamer + 0.0.1 + 2019 + + 2.4.0 + 5.3.2 + 1.9.1 + 2.13.0 + 20190722 + 1.4.0 + UTF-8 + 0.1.0 + 4.4 + - + + + confluent + https://packages.confluent.io/maven/ + + - - - confluent - https://packages.confluent.io/maven/ - - + + + com.typesafe + config + ${typesafe.config.version} + + + org.apache.kafka + kafka-streams + ${kafka.version} + + + org.apache.kafka + kafka-clients + ${kafka.version} + + + io.confluent + kafka-streams-avro-serde + ${confluent.version} + + + io.confluent + kafka-avro-serializer + ${confluent.version} + + + io.confluent + kafka-schema-registry-client + ${confluent.version} + + + io.confluent + common-config + ${confluent.version} + + + io.confluent + common-utils + ${confluent.version} + + + org.apache.avro + avro + ${avro.version} + + + + org.json + json + ${org.json.version} + + + junit + junit + ${junit.version} + test + + + org.apache.logging.log4j + log4j-api + ${log4j.version} + + + org.apache.logging.log4j + log4j-core + ${log4j.version} + + + io.keyko.monitoring + schemas + ${keyko.schemas.version} + + + org.apache.kafka + kafka-streams-test-utils + ${kafka.version} + test + + - - - com.typesafe - config - ${typesafe.config.version} - - - org.apache.kafka - kafka-streams - ${kafka.version} - - - org.apache.kafka - kafka-clients - ${kafka.version} - - - io.confluent - kafka-streams-avro-serde - 5.3.2 - - - io.confluent - kafka-avro-serializer - 5.3.0 - - - io.confluent - kafka-schema-registry-client - 5.3.2 - - - io.confluent - common-config - 5.3.2 - - - io.confluent - common-utils - 5.3.2 - - - org.apache.avro - avro - 1.9.1 - - - - org.json - json - 20190722 - - - com.fasterxml.jackson.module - jackson-module-scala_2.12 - 2.10.1 - - - junit - junit - 4.4 - test - - - org.apache.kafka - kafka-streams-test-utils - ${kafka.version} - test - - - org.mockito - mockito-core - 3.2.4 - test - - + - + - + + org.apache.maven.plugins + maven-shade-plugin + 2.4.3 + + + package + + shade + + + true + allinone + + + *:* + + + + + reference.conf + + + + io.keyko.monitoring.KeykoMonitoring + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.0 + + 11 + + + - - org.apache.maven.plugins - maven-shade-plugin - 2.4.3 - - - package - - shade - - - true - allinone - - - *:* - - - - - reference.conf - - - - io.keyko.monitoring.KeykoMonitoring - - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.0 - - 11 - - - - - + diff --git a/src/main/java/io/keyko/monitoring/KeykoMonitoring.java b/src/main/java/io/keyko/monitoring/KeykoMonitoring.java index 01ce69b..218bf1d 100644 --- a/src/main/java/io/keyko/monitoring/KeykoMonitoring.java +++ b/src/main/java/io/keyko/monitoring/KeykoMonitoring.java @@ -4,15 +4,18 @@ import com.typesafe.config.ConfigFactory; import io.keyko.monitoring.config.StreamerConfig; import io.keyko.monitoring.stream.EventStreamManager; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; public class KeykoMonitoring { + private static final Logger LOGGER = LogManager.getLogger(KeykoMonitoring.class); public static void main(final String[] args) throws Exception { Config config = args.length > 0 ? ConfigFactory.load(args[0]) : ConfigFactory.load(); StreamerConfig streamerConfig = StreamerConfig.getInstance(config); + LOGGER.info("Starting KeykoMonitoring..."); new EventStreamManager(streamerConfig).initStream(); - } } diff --git a/src/main/java/io/keyko/monitoring/config/StreamerConfig.java b/src/main/java/io/keyko/monitoring/config/StreamerConfig.java index 70f84d7..6a0729a 100644 --- a/src/main/java/io/keyko/monitoring/config/StreamerConfig.java +++ b/src/main/java/io/keyko/monitoring/config/StreamerConfig.java @@ -11,6 +11,7 @@ public class StreamerConfig { private static final String EVENT_BLOCK_TOPIC = "kafka.event-block-topic"; private static final String FLAT_EVENT_TOPIC = "kafka.flat-event-topic"; private static final String ACCOUNTS_AGGREGATION_TOPIC = "kafka.accounts-aggregation-topic"; + private static final String ALERTS_TOPIC = "kafka.alerts-topic"; private StreamerConfig() { @@ -23,6 +24,7 @@ private StreamerConfig() { private String eventBlockTopic; private String flatEventTopic; private String accountsAggregationTopic; + private String alertsTopic; private static StreamerConfig streamerConfig; @@ -41,6 +43,7 @@ public static StreamerConfig getInstance(Config config) { streamerConfig.setEventBlockTopic(config.getString(EVENT_BLOCK_TOPIC)); streamerConfig.setFlatEventTopic(config.getString(FLAT_EVENT_TOPIC)); streamerConfig.setAccountsAggregationTopic(config.getString(ACCOUNTS_AGGREGATION_TOPIC)); + streamerConfig.setAlertsTopic(config.getString(ALERTS_TOPIC)); return streamerConfig; @@ -104,4 +107,12 @@ public void setAccountsAggregationTopic(String accountsAggregationTopic) { this.accountsAggregationTopic = accountsAggregationTopic; } + public String getAlertsTopic() { + return alertsTopic; + } + + public void setAlertsTopic(String alertsTopic) { + this.alertsTopic = alertsTopic; + } + } diff --git a/src/main/java/io/keyko/monitoring/model/AccountCreatedAggregation.java b/src/main/java/io/keyko/monitoring/model/AccountCreatedAggregation.java index 5e5a884..718eec5 100644 --- a/src/main/java/io/keyko/monitoring/model/AccountCreatedAggregation.java +++ b/src/main/java/io/keyko/monitoring/model/AccountCreatedAggregation.java @@ -1,9 +1,12 @@ package io.keyko.monitoring.model; import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; public class AccountCreatedAggregation extends BaseAggregation { + private static final String DATE_PATTERN = "dd/MM/yyyy HH:mm:ss"; + private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DATE_PATTERN); private String type; @@ -13,6 +16,11 @@ public AccountCreatedAggregation(ZonedDateTime dateTime, Long count, String type } + @Override + protected String formatDateTime(ZonedDateTime datetime) { + return datetime.format(formatter); + } + public String getType() { return type; } diff --git a/src/main/java/io/keyko/monitoring/model/BaseAggregation.java b/src/main/java/io/keyko/monitoring/model/BaseAggregation.java index 210c2eb..55eba0f 100644 --- a/src/main/java/io/keyko/monitoring/model/BaseAggregation.java +++ b/src/main/java/io/keyko/monitoring/model/BaseAggregation.java @@ -19,7 +19,7 @@ public BaseAggregation(ZonedDateTime dateTime, Long count) { } - private String formatDateTime(ZonedDateTime datetime) { + protected String formatDateTime(ZonedDateTime datetime) { return datetime.format(formatter); } diff --git a/src/main/java/io/keyko/monitoring/serde/EventSerdes.java b/src/main/java/io/keyko/monitoring/serde/EventSerdes.java index 8131e4b..89fb590 100644 --- a/src/main/java/io/keyko/monitoring/serde/EventSerdes.java +++ b/src/main/java/io/keyko/monitoring/serde/EventSerdes.java @@ -1,13 +1,15 @@ package io.keyko.monitoring.serde; import io.confluent.kafka.streams.serdes.avro.SpecificAvroSerde; -import net.consensys.eventeum.BlockEvent; -import net.consensys.eventeum.ContractEvent; -import net.consensys.eventeum.EventBlock; +import io.keyko.monitoring.schemas.AlertEvent; +import io.keyko.monitoring.schemas.BlockEvent; +import io.keyko.monitoring.schemas.ContractEvent; +import io.keyko.monitoring.schemas.EventBlock; public interface EventSerdes { final SpecificAvroSerde eventAvroSerde = new SpecificAvroSerde<>(); final SpecificAvroSerde blockAvroSerde = new SpecificAvroSerde(); final SpecificAvroSerde eventBlockAvroSerde = new SpecificAvroSerde<>(); + final SpecificAvroSerde alertAvroSerde = new SpecificAvroSerde<>(); } diff --git a/src/main/java/io/keyko/monitoring/stream/EventProcessor.java b/src/main/java/io/keyko/monitoring/stream/EventProcessor.java index 7c8870d..b575492 100644 --- a/src/main/java/io/keyko/monitoring/stream/EventProcessor.java +++ b/src/main/java/io/keyko/monitoring/stream/EventProcessor.java @@ -1,33 +1,27 @@ package io.keyko.monitoring.stream; import io.keyko.monitoring.model.AccountCreatedAggregation; +import io.keyko.monitoring.schemas.*; import io.keyko.monitoring.time.EventBlockTimestampExtractor; -import io.keyko.monitoring.windows.DailyTimeWindows; -import net.consensys.eventeum.BlockEvent; -import net.consensys.eventeum.ContractEvent; -import net.consensys.eventeum.EventBlock; import org.apache.kafka.common.serialization.Serde; import org.apache.kafka.common.serialization.Serdes; -import org.apache.kafka.common.utils.Bytes; import org.apache.kafka.streams.KeyValue; import org.apache.kafka.streams.StreamsBuilder; import org.apache.kafka.streams.kstream.*; -import org.apache.kafka.streams.state.WindowStore; import java.time.Duration; import java.time.ZoneId; import java.time.ZoneOffset; +import java.time.format.DateTimeFormatter; import java.util.List; -import static org.apache.kafka.streams.kstream.Suppressed.BufferConfig.unbounded; - public class EventProcessor { /** * Filter the events that has been already confirmed. * * @param contractEvents KStream with the event from the topic contract-events generated by Eventeum - * @return KStream with the events that have been confirmed. + * @return KStream with the events that have been confirmed. */ public KStream filterConfirmed(KStream contractEvents) { return contractEvents @@ -51,7 +45,7 @@ public void splitTopics(KStream confirmedEvents, Serde with the result of join the event with the block corresponding. */ public KStream joinEventWithBlock(KStream eventAvroStream, KTable blockAvroStream, Serde eventAvroSerde, Serde blockAvroSerde) { @@ -78,10 +72,10 @@ public KStream joinEventWithBlock(KStream with the accounts created aggregation. */ public KStream accountDailyAggregation(List topicsToAggregate, StreamsBuilder builder, Serde eventBlockAvroSerde) { @@ -99,15 +93,15 @@ public KStream accountDailyAggregation(List event.getDetails().getName()) .groupByKey(Grouped.with(Serdes.String(), eventBlockAvroSerde)) - .windowedBy(new DailyTimeWindows(zone, windowStartHour, gracePeriod)) - // .windowedBy(TimeWindows.of(Duration.ofSeconds(10))) - .count(Materialized.>with(Serdes.String(), Serdes.Long()) + //.windowedBy(new DailyTimeWindows(zone, windowStartHour, gracePeriod)) + .windowedBy(TimeWindows.of(Duration.ofSeconds(60))) + .count()//Materialized.>with(Serdes.String(), Serdes.Long()) // the default store retention time is 1 day; // need to explicitly increase the retention time // to allow for a 1-day window plus configured grace period - .withRetention(Duration.ofDays(1L).plus(gracePeriod))) + //.withRetention(Duration.ofDays(1L).plus(gracePeriod))) // emits the final count when the window is closed. - .suppress(Suppressed.untilWindowCloses(unbounded())); + //.suppress(Suppressed.untilWindowCloses(unbounded())); ; return formatAccountCreatedAggregation(accountsCreatedDayTable, zone); @@ -118,9 +112,9 @@ public KStream accountDailyAggregation(List with the accounts created aggregation. */ private KStream formatAccountCreatedAggregation(KTable, Long> accountsCreatedDayTable, ZoneId zone) { @@ -135,15 +129,39 @@ private KStream formatAccountCreatedAggregati ); - //DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy - HH:mm:ss Z"); - //String formattedString = windowed.window().startTime().atZone(ZoneOffset.UTC).format(formatter); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy - HH:mm:ss Z"); + String formattedString = windowed.window().startTime().atZone(ZoneOffset.UTC).format(formatter); - //String key = windowed.key().concat("-").concat(formattedString); + String key = windowed.key().concat("-").concat(formattedString); - String key = windowed.key().concat("-").concat(accountCreatedAggregation.getDate()); + //String key = windowed.key().concat("-").concat(accountCreatedAggregation.getDate()); return KeyValue.pair(key, accountCreatedAggregation); }); } + + /** + * Filter the EpochRewardsDistributedToVoters event to release an alert when the + * + * @param builder Stream builder. + * @param EpochRewardsDistributedToVoters List with the name of the topic for the aggregation. + * @param eventBlockAvroSerde EventBlock avro serde. + * @return KStream with the alert event released when the condition is satisfied. + */ + public KStream alertNoEpochRewardsDistributed(StreamsBuilder builder, List EpochRewardsDistributedToVoters, Serde eventBlockAvroSerde) { + return builder.stream(EpochRewardsDistributedToVoters, Consumed.with(Serdes.String(), eventBlockAvroSerde)) + .filter((key, event) -> ((NumberParameter) event.getDetails().getNonIndexedParameters().get(0)).getValue().equals("0")) + .map((key, event) -> + KeyValue.pair(key, + AlertEvent.newBuilder() + .setName("alertNoEpochRewardsDistributed") + .setReference(event.getId()) + .setStatus(AlertEventStatus.ERROR) + .setTimestamp(event.getDetailsBlock().getTimestamp()) + .setDescription("NoEpochRewardsDistributed for group: " + ((StringParameter) event.getDetails().getIndexedParameters().get(0)).getValue()) + .build()) + ); + } + } diff --git a/src/main/java/io/keyko/monitoring/stream/EventStreamManager.java b/src/main/java/io/keyko/monitoring/stream/EventStreamManager.java index fbad796..b9c1513 100644 --- a/src/main/java/io/keyko/monitoring/stream/EventStreamManager.java +++ b/src/main/java/io/keyko/monitoring/stream/EventStreamManager.java @@ -3,11 +3,12 @@ import io.confluent.kafka.serializers.AbstractKafkaAvroSerDeConfig; import io.keyko.monitoring.config.StreamerConfig; import io.keyko.monitoring.model.AccountCreatedAggregation; +import io.keyko.monitoring.schemas.AlertEvent; +import io.keyko.monitoring.schemas.BlockEvent; +import io.keyko.monitoring.schemas.ContractEvent; +import io.keyko.monitoring.schemas.EventBlock; import io.keyko.monitoring.serde.EventSerdes; import io.keyko.monitoring.serde.JsonPOJOSerde; -import net.consensys.eventeum.BlockEvent; -import net.consensys.eventeum.ContractEvent; -import net.consensys.eventeum.EventBlock; import org.apache.kafka.clients.consumer.ConsumerConfig; import org.apache.kafka.common.serialization.Serdes; import org.apache.kafka.streams.KafkaStreams; @@ -17,6 +18,8 @@ import org.apache.kafka.streams.kstream.KStream; import org.apache.kafka.streams.kstream.KTable; import org.apache.kafka.streams.kstream.Produced; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import java.util.*; @@ -25,6 +28,7 @@ public class EventStreamManager implements EventSerdes { private StreamerConfig configuration; private static final Integer DEFAULT_THREADS = 1; private static final Integer DEFAULT_REPLICATION_FACTOR = 1; + private static final Logger LOGGER = LogManager.getLogger(EventStreamManager.class); public EventStreamManager(StreamerConfig streamerConfig) { @@ -82,6 +86,7 @@ private KafkaStreams createStreams() { eventAvroSerde.configure(serdeConfig, false); blockAvroSerde.configure(serdeConfig, false); eventBlockAvroSerde.configure(serdeConfig, false); + alertAvroSerde.configure(serdeConfig, false); KStream contractEvents = builder.stream(configuration.getContractEventTopic(), Consumed.with(Serdes.String(), eventAvroSerde)); @@ -99,6 +104,9 @@ private KafkaStreams createStreams() { KStream accountsCreatedDayStream = eventProcessor.accountDailyAggregation(accountsTopics, builder, eventBlockAvroSerde); accountsCreatedDayStream.to(configuration.getAccountsAggregationTopic(), Produced.with(Serdes.String(), new JsonPOJOSerde(AccountCreatedAggregation.class))); + KStream alertEventKStream = eventProcessor.alertNoEpochRewardsDistributed(builder, Collections.singletonList("EpochRewardsDistributedToVoters".toLowerCase()), eventBlockAvroSerde); + alertEventKStream.to(configuration.getAlertsTopic(), Produced.with(Serdes.String(),alertAvroSerde)); + return new KafkaStreams(builder.build(), this.getStreamConfiguration()); } diff --git a/src/main/java/io/keyko/monitoring/time/EventBlockTimestampExtractor.java b/src/main/java/io/keyko/monitoring/time/EventBlockTimestampExtractor.java index 449a26b..5243b79 100644 --- a/src/main/java/io/keyko/monitoring/time/EventBlockTimestampExtractor.java +++ b/src/main/java/io/keyko/monitoring/time/EventBlockTimestampExtractor.java @@ -1,6 +1,6 @@ package io.keyko.monitoring.time; -import net.consensys.eventeum.EventBlock; +import io.keyko.monitoring.schemas.EventBlock; import org.apache.kafka.clients.consumer.ConsumerRecord; import org.apache.kafka.streams.processor.TimestampExtractor; diff --git a/src/main/java/net/consensys/eventeum/BlockDetails.java b/src/main/java/net/consensys/eventeum/BlockDetails.java deleted file mode 100644 index 55441e2..0000000 --- a/src/main/java/net/consensys/eventeum/BlockDetails.java +++ /dev/null @@ -1,581 +0,0 @@ -/** - * Autogenerated by Avro - *

- * DO NOT EDIT DIRECTLY - */ -package net.consensys.eventeum; - -import org.apache.avro.message.BinaryMessageDecoder; -import org.apache.avro.message.BinaryMessageEncoder; -import org.apache.avro.message.SchemaStore; -import org.apache.avro.specific.SpecificData; - -@org.apache.avro.specific.AvroGenerated -public class BlockDetails extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = 6934724161586224901L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"BlockDetails\",\"namespace\":\"net.consensys.eventeum\",\"fields\":[{\"name\":\"number\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"hash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"timestamp\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}"); - - public static org.apache.avro.Schema getClassSchema() { - return SCHEMA$; - } - - private static SpecificData MODEL$ = new SpecificData(); - - private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); - - private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); - - /** - * Return the BinaryMessageEncoder instance used by this class. - * @return the message encoder used by this class - */ - public static BinaryMessageEncoder getEncoder() { - return ENCODER; - } - - /** - * Return the BinaryMessageDecoder instance used by this class. - * @return the message decoder used by this class - */ - public static BinaryMessageDecoder getDecoder() { - return DECODER; - } - - /** - * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}. - * @param resolver a {@link SchemaStore} used to find schemas by fingerprint - * @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore - */ - public static BinaryMessageDecoder createDecoder(SchemaStore resolver) { - return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver); - } - - /** - * Serializes this BlockDetails to a ByteBuffer. - * @return a buffer holding the serialized data for this instance - * @throws java.io.IOException if this instance could not be serialized - */ - public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { - return ENCODER.encode(this); - } - - /** - * Deserializes a BlockDetails from a ByteBuffer. - * @param b a byte buffer holding serialized data for an instance of this class - * @return a BlockDetails instance decoded from the given buffer - * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class - */ - public static BlockDetails fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { - return DECODER.decode(b); - } - - @Deprecated - public String number; - @Deprecated - public String hash; - @Deprecated - public String timestamp; - @Deprecated - public String nodeName; - - /** - * Default constructor. Note that this does not initialize fields - * to their default values from the schema. If that is desired then - * one should use newBuilder(). - */ - public BlockDetails() { - } - - /** - * All-args constructor. - * @param number The new value for number - * @param hash The new value for hash - * @param timestamp The new value for timestamp - * @param nodeName The new value for nodeName - */ - public BlockDetails(String number, String hash, String timestamp, String nodeName) { - this.number = number; - this.hash = hash; - this.timestamp = timestamp; - this.nodeName = nodeName; - } - - public org.apache.avro.specific.SpecificData getSpecificData() { - return MODEL$; - } - - public org.apache.avro.Schema getSchema() { - return SCHEMA$; - } - - // Used by DatumWriter. Applications should not call. - public Object get(int field$) { - switch (field$) { - case 0: - return number; - case 1: - return hash; - case 2: - return timestamp; - case 3: - return nodeName; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - // Used by DatumReader. Applications should not call. - @SuppressWarnings(value = "unchecked") - public void put(int field$, Object value$) { - switch (field$) { - case 0: - number = (String) value$; - break; - case 1: - hash = (String) value$; - break; - case 2: - timestamp = (String) value$; - break; - case 3: - nodeName = (String) value$; - break; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - /** - * Gets the value of the 'number' field. - * @return The value of the 'number' field. - */ - public String getNumber() { - return number; - } - - - /** - * Sets the value of the 'number' field. - * @param value the value to set. - */ - public void setNumber(String value) { - this.number = value; - } - - /** - * Gets the value of the 'hash' field. - * @return The value of the 'hash' field. - */ - public String getHash() { - return hash; - } - - - /** - * Sets the value of the 'hash' field. - * @param value the value to set. - */ - public void setHash(String value) { - this.hash = value; - } - - /** - * Gets the value of the 'timestamp' field. - * @return The value of the 'timestamp' field. - */ - public String getTimestamp() { - return timestamp; - } - - - /** - * Sets the value of the 'timestamp' field. - * @param value the value to set. - */ - public void setTimestamp(String value) { - this.timestamp = value; - } - - /** - * Gets the value of the 'nodeName' field. - * @return The value of the 'nodeName' field. - */ - public String getNodeName() { - return nodeName; - } - - - /** - * Sets the value of the 'nodeName' field. - * @param value the value to set. - */ - public void setNodeName(String value) { - this.nodeName = value; - } - - /** - * Creates a new BlockDetails RecordBuilder. - * @return A new BlockDetails RecordBuilder - */ - public static net.consensys.eventeum.BlockDetails.Builder newBuilder() { - return new net.consensys.eventeum.BlockDetails.Builder(); - } - - /** - * Creates a new BlockDetails RecordBuilder by copying an existing Builder. - * @param other The existing builder to copy. - * @return A new BlockDetails RecordBuilder - */ - public static net.consensys.eventeum.BlockDetails.Builder newBuilder(net.consensys.eventeum.BlockDetails.Builder other) { - if (other == null) { - return new net.consensys.eventeum.BlockDetails.Builder(); - } else { - return new net.consensys.eventeum.BlockDetails.Builder(other); - } - } - - /** - * Creates a new BlockDetails RecordBuilder by copying an existing BlockDetails instance. - * @param other The existing instance to copy. - * @return A new BlockDetails RecordBuilder - */ - public static net.consensys.eventeum.BlockDetails.Builder newBuilder(net.consensys.eventeum.BlockDetails other) { - if (other == null) { - return new net.consensys.eventeum.BlockDetails.Builder(); - } else { - return new net.consensys.eventeum.BlockDetails.Builder(other); - } - } - - /** - * RecordBuilder for BlockDetails instances. - */ - public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase - implements org.apache.avro.data.RecordBuilder { - - private String number; - private String hash; - private String timestamp; - private String nodeName; - - /** Creates a new Builder */ - private Builder() { - super(SCHEMA$); - } - - /** - * Creates a Builder by copying an existing Builder. - * @param other The existing Builder to copy. - */ - private Builder(net.consensys.eventeum.BlockDetails.Builder other) { - super(other); - if (isValidValue(fields()[0], other.number)) { - this.number = data().deepCopy(fields()[0].schema(), other.number); - fieldSetFlags()[0] = other.fieldSetFlags()[0]; - } - if (isValidValue(fields()[1], other.hash)) { - this.hash = data().deepCopy(fields()[1].schema(), other.hash); - fieldSetFlags()[1] = other.fieldSetFlags()[1]; - } - if (isValidValue(fields()[2], other.timestamp)) { - this.timestamp = data().deepCopy(fields()[2].schema(), other.timestamp); - fieldSetFlags()[2] = other.fieldSetFlags()[2]; - } - if (isValidValue(fields()[3], other.nodeName)) { - this.nodeName = data().deepCopy(fields()[3].schema(), other.nodeName); - fieldSetFlags()[3] = other.fieldSetFlags()[3]; - } - } - - /** - * Creates a Builder by copying an existing BlockDetails instance - * @param other The existing instance to copy. - */ - private Builder(net.consensys.eventeum.BlockDetails other) { - super(SCHEMA$); - if (isValidValue(fields()[0], other.number)) { - this.number = data().deepCopy(fields()[0].schema(), other.number); - fieldSetFlags()[0] = true; - } - if (isValidValue(fields()[1], other.hash)) { - this.hash = data().deepCopy(fields()[1].schema(), other.hash); - fieldSetFlags()[1] = true; - } - if (isValidValue(fields()[2], other.timestamp)) { - this.timestamp = data().deepCopy(fields()[2].schema(), other.timestamp); - fieldSetFlags()[2] = true; - } - if (isValidValue(fields()[3], other.nodeName)) { - this.nodeName = data().deepCopy(fields()[3].schema(), other.nodeName); - fieldSetFlags()[3] = true; - } - } - - /** - * Gets the value of the 'number' field. - * @return The value. - */ - public String getNumber() { - return number; - } - - - /** - * Sets the value of the 'number' field. - * @param value The value of 'number'. - * @return This builder. - */ - public net.consensys.eventeum.BlockDetails.Builder setNumber(String value) { - validate(fields()[0], value); - this.number = value; - fieldSetFlags()[0] = true; - return this; - } - - /** - * Checks whether the 'number' field has been set. - * @return True if the 'number' field has been set, false otherwise. - */ - public boolean hasNumber() { - return fieldSetFlags()[0]; - } - - - /** - * Clears the value of the 'number' field. - * @return This builder. - */ - public net.consensys.eventeum.BlockDetails.Builder clearNumber() { - number = null; - fieldSetFlags()[0] = false; - return this; - } - - /** - * Gets the value of the 'hash' field. - * @return The value. - */ - public String getHash() { - return hash; - } - - - /** - * Sets the value of the 'hash' field. - * @param value The value of 'hash'. - * @return This builder. - */ - public net.consensys.eventeum.BlockDetails.Builder setHash(String value) { - validate(fields()[1], value); - this.hash = value; - fieldSetFlags()[1] = true; - return this; - } - - /** - * Checks whether the 'hash' field has been set. - * @return True if the 'hash' field has been set, false otherwise. - */ - public boolean hasHash() { - return fieldSetFlags()[1]; - } - - - /** - * Clears the value of the 'hash' field. - * @return This builder. - */ - public net.consensys.eventeum.BlockDetails.Builder clearHash() { - hash = null; - fieldSetFlags()[1] = false; - return this; - } - - /** - * Gets the value of the 'timestamp' field. - * @return The value. - */ - public String getTimestamp() { - return timestamp; - } - - - /** - * Sets the value of the 'timestamp' field. - * @param value The value of 'timestamp'. - * @return This builder. - */ - public net.consensys.eventeum.BlockDetails.Builder setTimestamp(String value) { - validate(fields()[2], value); - this.timestamp = value; - fieldSetFlags()[2] = true; - return this; - } - - /** - * Checks whether the 'timestamp' field has been set. - * @return True if the 'timestamp' field has been set, false otherwise. - */ - public boolean hasTimestamp() { - return fieldSetFlags()[2]; - } - - - /** - * Clears the value of the 'timestamp' field. - * @return This builder. - */ - public net.consensys.eventeum.BlockDetails.Builder clearTimestamp() { - timestamp = null; - fieldSetFlags()[2] = false; - return this; - } - - /** - * Gets the value of the 'nodeName' field. - * @return The value. - */ - public String getNodeName() { - return nodeName; - } - - - /** - * Sets the value of the 'nodeName' field. - * @param value The value of 'nodeName'. - * @return This builder. - */ - public net.consensys.eventeum.BlockDetails.Builder setNodeName(String value) { - validate(fields()[3], value); - this.nodeName = value; - fieldSetFlags()[3] = true; - return this; - } - - /** - * Checks whether the 'nodeName' field has been set. - * @return True if the 'nodeName' field has been set, false otherwise. - */ - public boolean hasNodeName() { - return fieldSetFlags()[3]; - } - - - /** - * Clears the value of the 'nodeName' field. - * @return This builder. - */ - public net.consensys.eventeum.BlockDetails.Builder clearNodeName() { - nodeName = null; - fieldSetFlags()[3] = false; - return this; - } - - @Override - @SuppressWarnings("unchecked") - public BlockDetails build() { - try { - BlockDetails record = new BlockDetails(); - record.number = fieldSetFlags()[0] ? this.number : (String) defaultValue(fields()[0]); - record.hash = fieldSetFlags()[1] ? this.hash : (String) defaultValue(fields()[1]); - record.timestamp = fieldSetFlags()[2] ? this.timestamp : (String) defaultValue(fields()[2]); - record.nodeName = fieldSetFlags()[3] ? this.nodeName : (String) defaultValue(fields()[3]); - return record; - } catch (org.apache.avro.AvroMissingFieldException e) { - throw e; - } catch (Exception e) { - throw new org.apache.avro.AvroRuntimeException(e); - } - } - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter) MODEL$.createDatumWriter(SCHEMA$); - - @Override - public void writeExternal(java.io.ObjectOutput out) - throws java.io.IOException { - WRITER$.write(this, SpecificData.getEncoder(out)); - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader) MODEL$.createDatumReader(SCHEMA$); - - @Override - public void readExternal(java.io.ObjectInput in) - throws java.io.IOException { - READER$.read(this, SpecificData.getDecoder(in)); - } - - @Override - protected boolean hasCustomCoders() { - return true; - } - - @Override - public void customEncode(org.apache.avro.io.Encoder out) - throws java.io.IOException { - out.writeString(this.number); - - out.writeString(this.hash); - - out.writeString(this.timestamp); - - out.writeString(this.nodeName); - - } - - @Override - public void customDecode(org.apache.avro.io.ResolvingDecoder in) - throws java.io.IOException { - org.apache.avro.Schema.Field[] fieldOrder = in.readFieldOrderIfDiff(); - if (fieldOrder == null) { - this.number = in.readString(); - - this.hash = in.readString(); - - this.timestamp = in.readString(); - - this.nodeName = in.readString(); - - } else { - for (int i = 0; i < 4; i++) { - switch (fieldOrder[i].pos()) { - case 0: - this.number = in.readString(); - break; - - case 1: - this.hash = in.readString(); - break; - - case 2: - this.timestamp = in.readString(); - break; - - case 3: - this.nodeName = in.readString(); - break; - - default: - throw new java.io.IOException("Corrupt ResolvingDecoder."); - } - } - } - } -} - - - - - - - - - - diff --git a/src/main/java/net/consensys/eventeum/BlockEvent.java b/src/main/java/net/consensys/eventeum/BlockEvent.java deleted file mode 100644 index abf00de..0000000 --- a/src/main/java/net/consensys/eventeum/BlockEvent.java +++ /dev/null @@ -1,635 +0,0 @@ -/** - * Autogenerated by Avro - *

- * DO NOT EDIT DIRECTLY - */ -package net.consensys.eventeum; - -import org.apache.avro.message.BinaryMessageDecoder; -import org.apache.avro.message.BinaryMessageEncoder; -import org.apache.avro.message.SchemaStore; -import org.apache.avro.specific.SpecificData; - -@org.apache.avro.specific.AvroGenerated -public class BlockEvent extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = -4269460057361371108L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"BlockEvent\",\"namespace\":\"net.consensys.eventeum\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"details\",\"type\":{\"type\":\"record\",\"name\":\"BlockDetails\",\"fields\":[{\"name\":\"number\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"hash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"timestamp\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}},{\"name\":\"retries\",\"type\":\"int\"}]}"); - - public static org.apache.avro.Schema getClassSchema() { - return SCHEMA$; - } - - private static SpecificData MODEL$ = new SpecificData(); - - private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); - - private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); - - /** - * Return the BinaryMessageEncoder instance used by this class. - * @return the message encoder used by this class - */ - public static BinaryMessageEncoder getEncoder() { - return ENCODER; - } - - /** - * Return the BinaryMessageDecoder instance used by this class. - * @return the message decoder used by this class - */ - public static BinaryMessageDecoder getDecoder() { - return DECODER; - } - - /** - * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}. - * @param resolver a {@link SchemaStore} used to find schemas by fingerprint - * @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore - */ - public static BinaryMessageDecoder createDecoder(SchemaStore resolver) { - return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver); - } - - /** - * Serializes this BlockEvent to a ByteBuffer. - * @return a buffer holding the serialized data for this instance - * @throws java.io.IOException if this instance could not be serialized - */ - public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { - return ENCODER.encode(this); - } - - /** - * Deserializes a BlockEvent from a ByteBuffer. - * @param b a byte buffer holding serialized data for an instance of this class - * @return a BlockEvent instance decoded from the given buffer - * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class - */ - public static BlockEvent fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { - return DECODER.decode(b); - } - - @Deprecated - public String id; - @Deprecated - public String type; - @Deprecated - public net.consensys.eventeum.BlockDetails details; - @Deprecated - public int retries; - - /** - * Default constructor. Note that this does not initialize fields - * to their default values from the schema. If that is desired then - * one should use newBuilder(). - */ - public BlockEvent() { - } - - /** - * All-args constructor. - * @param id The new value for id - * @param type The new value for type - * @param details The new value for details - * @param retries The new value for retries - */ - public BlockEvent(String id, String type, net.consensys.eventeum.BlockDetails details, Integer retries) { - this.id = id; - this.type = type; - this.details = details; - this.retries = retries; - } - - public org.apache.avro.specific.SpecificData getSpecificData() { - return MODEL$; - } - - public org.apache.avro.Schema getSchema() { - return SCHEMA$; - } - - // Used by DatumWriter. Applications should not call. - public Object get(int field$) { - switch (field$) { - case 0: - return id; - case 1: - return type; - case 2: - return details; - case 3: - return retries; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - // Used by DatumReader. Applications should not call. - @SuppressWarnings(value = "unchecked") - public void put(int field$, Object value$) { - switch (field$) { - case 0: - id = (String) value$; - break; - case 1: - type = (String) value$; - break; - case 2: - details = (net.consensys.eventeum.BlockDetails) value$; - break; - case 3: - retries = (Integer) value$; - break; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - /** - * Gets the value of the 'id' field. - * @return The value of the 'id' field. - */ - public String getId() { - return id; - } - - - /** - * Sets the value of the 'id' field. - * @param value the value to set. - */ - public void setId(String value) { - this.id = value; - } - - /** - * Gets the value of the 'type' field. - * @return The value of the 'type' field. - */ - public String getType() { - return type; - } - - - /** - * Sets the value of the 'type' field. - * @param value the value to set. - */ - public void setType(String value) { - this.type = value; - } - - /** - * Gets the value of the 'details' field. - * @return The value of the 'details' field. - */ - public net.consensys.eventeum.BlockDetails getDetails() { - return details; - } - - - /** - * Sets the value of the 'details' field. - * @param value the value to set. - */ - public void setDetails(net.consensys.eventeum.BlockDetails value) { - this.details = value; - } - - /** - * Gets the value of the 'retries' field. - * @return The value of the 'retries' field. - */ - public int getRetries() { - return retries; - } - - - /** - * Sets the value of the 'retries' field. - * @param value the value to set. - */ - public void setRetries(int value) { - this.retries = value; - } - - /** - * Creates a new BlockEvent RecordBuilder. - * @return A new BlockEvent RecordBuilder - */ - public static net.consensys.eventeum.BlockEvent.Builder newBuilder() { - return new net.consensys.eventeum.BlockEvent.Builder(); - } - - /** - * Creates a new BlockEvent RecordBuilder by copying an existing Builder. - * @param other The existing builder to copy. - * @return A new BlockEvent RecordBuilder - */ - public static net.consensys.eventeum.BlockEvent.Builder newBuilder(net.consensys.eventeum.BlockEvent.Builder other) { - if (other == null) { - return new net.consensys.eventeum.BlockEvent.Builder(); - } else { - return new net.consensys.eventeum.BlockEvent.Builder(other); - } - } - - /** - * Creates a new BlockEvent RecordBuilder by copying an existing BlockEvent instance. - * @param other The existing instance to copy. - * @return A new BlockEvent RecordBuilder - */ - public static net.consensys.eventeum.BlockEvent.Builder newBuilder(net.consensys.eventeum.BlockEvent other) { - if (other == null) { - return new net.consensys.eventeum.BlockEvent.Builder(); - } else { - return new net.consensys.eventeum.BlockEvent.Builder(other); - } - } - - /** - * RecordBuilder for BlockEvent instances. - */ - public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase - implements org.apache.avro.data.RecordBuilder { - - private String id; - private String type; - private net.consensys.eventeum.BlockDetails details; - private net.consensys.eventeum.BlockDetails.Builder detailsBuilder; - private int retries; - - /** Creates a new Builder */ - private Builder() { - super(SCHEMA$); - } - - /** - * Creates a Builder by copying an existing Builder. - * @param other The existing Builder to copy. - */ - private Builder(net.consensys.eventeum.BlockEvent.Builder other) { - super(other); - if (isValidValue(fields()[0], other.id)) { - this.id = data().deepCopy(fields()[0].schema(), other.id); - fieldSetFlags()[0] = other.fieldSetFlags()[0]; - } - if (isValidValue(fields()[1], other.type)) { - this.type = data().deepCopy(fields()[1].schema(), other.type); - fieldSetFlags()[1] = other.fieldSetFlags()[1]; - } - if (isValidValue(fields()[2], other.details)) { - this.details = data().deepCopy(fields()[2].schema(), other.details); - fieldSetFlags()[2] = other.fieldSetFlags()[2]; - } - if (other.hasDetailsBuilder()) { - this.detailsBuilder = net.consensys.eventeum.BlockDetails.newBuilder(other.getDetailsBuilder()); - } - if (isValidValue(fields()[3], other.retries)) { - this.retries = data().deepCopy(fields()[3].schema(), other.retries); - fieldSetFlags()[3] = other.fieldSetFlags()[3]; - } - } - - /** - * Creates a Builder by copying an existing BlockEvent instance - * @param other The existing instance to copy. - */ - private Builder(net.consensys.eventeum.BlockEvent other) { - super(SCHEMA$); - if (isValidValue(fields()[0], other.id)) { - this.id = data().deepCopy(fields()[0].schema(), other.id); - fieldSetFlags()[0] = true; - } - if (isValidValue(fields()[1], other.type)) { - this.type = data().deepCopy(fields()[1].schema(), other.type); - fieldSetFlags()[1] = true; - } - if (isValidValue(fields()[2], other.details)) { - this.details = data().deepCopy(fields()[2].schema(), other.details); - fieldSetFlags()[2] = true; - } - this.detailsBuilder = null; - if (isValidValue(fields()[3], other.retries)) { - this.retries = data().deepCopy(fields()[3].schema(), other.retries); - fieldSetFlags()[3] = true; - } - } - - /** - * Gets the value of the 'id' field. - * @return The value. - */ - public String getId() { - return id; - } - - - /** - * Sets the value of the 'id' field. - * @param value The value of 'id'. - * @return This builder. - */ - public net.consensys.eventeum.BlockEvent.Builder setId(String value) { - validate(fields()[0], value); - this.id = value; - fieldSetFlags()[0] = true; - return this; - } - - /** - * Checks whether the 'id' field has been set. - * @return True if the 'id' field has been set, false otherwise. - */ - public boolean hasId() { - return fieldSetFlags()[0]; - } - - - /** - * Clears the value of the 'id' field. - * @return This builder. - */ - public net.consensys.eventeum.BlockEvent.Builder clearId() { - id = null; - fieldSetFlags()[0] = false; - return this; - } - - /** - * Gets the value of the 'type' field. - * @return The value. - */ - public String getType() { - return type; - } - - - /** - * Sets the value of the 'type' field. - * @param value The value of 'type'. - * @return This builder. - */ - public net.consensys.eventeum.BlockEvent.Builder setType(String value) { - validate(fields()[1], value); - this.type = value; - fieldSetFlags()[1] = true; - return this; - } - - /** - * Checks whether the 'type' field has been set. - * @return True if the 'type' field has been set, false otherwise. - */ - public boolean hasType() { - return fieldSetFlags()[1]; - } - - - /** - * Clears the value of the 'type' field. - * @return This builder. - */ - public net.consensys.eventeum.BlockEvent.Builder clearType() { - type = null; - fieldSetFlags()[1] = false; - return this; - } - - /** - * Gets the value of the 'details' field. - * @return The value. - */ - public net.consensys.eventeum.BlockDetails getDetails() { - return details; - } - - - /** - * Sets the value of the 'details' field. - * @param value The value of 'details'. - * @return This builder. - */ - public net.consensys.eventeum.BlockEvent.Builder setDetails(net.consensys.eventeum.BlockDetails value) { - validate(fields()[2], value); - this.detailsBuilder = null; - this.details = value; - fieldSetFlags()[2] = true; - return this; - } - - /** - * Checks whether the 'details' field has been set. - * @return True if the 'details' field has been set, false otherwise. - */ - public boolean hasDetails() { - return fieldSetFlags()[2]; - } - - /** - * Gets the Builder instance for the 'details' field and creates one if it doesn't exist yet. - * @return This builder. - */ - public net.consensys.eventeum.BlockDetails.Builder getDetailsBuilder() { - if (detailsBuilder == null) { - if (hasDetails()) { - setDetailsBuilder(net.consensys.eventeum.BlockDetails.newBuilder(details)); - } else { - setDetailsBuilder(net.consensys.eventeum.BlockDetails.newBuilder()); - } - } - return detailsBuilder; - } - - /** - * Sets the Builder instance for the 'details' field - * @param value The builder instance that must be set. - * @return This builder. - */ - public net.consensys.eventeum.BlockEvent.Builder setDetailsBuilder(net.consensys.eventeum.BlockDetails.Builder value) { - clearDetails(); - detailsBuilder = value; - return this; - } - - /** - * Checks whether the 'details' field has an active Builder instance - * @return True if the 'details' field has an active Builder instance - */ - public boolean hasDetailsBuilder() { - return detailsBuilder != null; - } - - /** - * Clears the value of the 'details' field. - * @return This builder. - */ - public net.consensys.eventeum.BlockEvent.Builder clearDetails() { - details = null; - detailsBuilder = null; - fieldSetFlags()[2] = false; - return this; - } - - /** - * Gets the value of the 'retries' field. - * @return The value. - */ - public int getRetries() { - return retries; - } - - - /** - * Sets the value of the 'retries' field. - * @param value The value of 'retries'. - * @return This builder. - */ - public net.consensys.eventeum.BlockEvent.Builder setRetries(int value) { - validate(fields()[3], value); - this.retries = value; - fieldSetFlags()[3] = true; - return this; - } - - /** - * Checks whether the 'retries' field has been set. - * @return True if the 'retries' field has been set, false otherwise. - */ - public boolean hasRetries() { - return fieldSetFlags()[3]; - } - - - /** - * Clears the value of the 'retries' field. - * @return This builder. - */ - public net.consensys.eventeum.BlockEvent.Builder clearRetries() { - fieldSetFlags()[3] = false; - return this; - } - - @Override - @SuppressWarnings("unchecked") - public BlockEvent build() { - try { - BlockEvent record = new BlockEvent(); - record.id = fieldSetFlags()[0] ? this.id : (String) defaultValue(fields()[0]); - record.type = fieldSetFlags()[1] ? this.type : (String) defaultValue(fields()[1]); - if (detailsBuilder != null) { - try { - record.details = this.detailsBuilder.build(); - } catch (org.apache.avro.AvroMissingFieldException e) { - e.addParentField(record.getSchema().getField("details")); - throw e; - } - } else { - record.details = fieldSetFlags()[2] ? this.details : (net.consensys.eventeum.BlockDetails) defaultValue(fields()[2]); - } - record.retries = fieldSetFlags()[3] ? this.retries : (Integer) defaultValue(fields()[3]); - return record; - } catch (org.apache.avro.AvroMissingFieldException e) { - throw e; - } catch (Exception e) { - throw new org.apache.avro.AvroRuntimeException(e); - } - } - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter) MODEL$.createDatumWriter(SCHEMA$); - - @Override - public void writeExternal(java.io.ObjectOutput out) - throws java.io.IOException { - WRITER$.write(this, SpecificData.getEncoder(out)); - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader) MODEL$.createDatumReader(SCHEMA$); - - @Override - public void readExternal(java.io.ObjectInput in) - throws java.io.IOException { - READER$.read(this, SpecificData.getDecoder(in)); - } - - @Override - protected boolean hasCustomCoders() { - return true; - } - - @Override - public void customEncode(org.apache.avro.io.Encoder out) - throws java.io.IOException { - out.writeString(this.id); - - out.writeString(this.type); - - this.details.customEncode(out); - - out.writeInt(this.retries); - - } - - @Override - public void customDecode(org.apache.avro.io.ResolvingDecoder in) - throws java.io.IOException { - org.apache.avro.Schema.Field[] fieldOrder = in.readFieldOrderIfDiff(); - if (fieldOrder == null) { - this.id = in.readString(); - - this.type = in.readString(); - - if (this.details == null) { - this.details = new net.consensys.eventeum.BlockDetails(); - } - this.details.customDecode(in); - - this.retries = in.readInt(); - - } else { - for (int i = 0; i < 4; i++) { - switch (fieldOrder[i].pos()) { - case 0: - this.id = in.readString(); - break; - - case 1: - this.type = in.readString(); - break; - - case 2: - if (this.details == null) { - this.details = new net.consensys.eventeum.BlockDetails(); - } - this.details.customDecode(in); - break; - - case 3: - this.retries = in.readInt(); - break; - - default: - throw new java.io.IOException("Corrupt ResolvingDecoder."); - } - } - } - } -} - - - - - - - - - - diff --git a/src/main/java/net/consensys/eventeum/ContractEvent.java b/src/main/java/net/consensys/eventeum/ContractEvent.java deleted file mode 100644 index 6fd5087..0000000 --- a/src/main/java/net/consensys/eventeum/ContractEvent.java +++ /dev/null @@ -1,573 +0,0 @@ -/** - * Autogenerated by Avro - *

- * DO NOT EDIT DIRECTLY - */ -package net.consensys.eventeum; - -import org.apache.avro.message.BinaryMessageDecoder; -import org.apache.avro.message.BinaryMessageEncoder; -import org.apache.avro.message.SchemaStore; -import org.apache.avro.specific.SpecificData; - -@org.apache.avro.specific.AvroGenerated -public class ContractEvent extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = -7300114330920817296L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"ContractEvent\",\"namespace\":\"net.consensys.eventeum\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"details\",\"type\":{\"type\":\"record\",\"name\":\"ContractEventDetails\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"filterId\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"indexedParameters\",\"type\":{\"type\":\"array\",\"items\":[{\"type\":\"record\",\"name\":\"StringParameter\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]},{\"type\":\"record\",\"name\":\"NumberParameter\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"}]}]}},{\"name\":\"nonIndexedParameters\",\"type\":{\"type\":\"array\",\"items\":[\"StringParameter\",\"NumberParameter\"]}},{\"name\":\"transactionHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"logIndex\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"blockNumber\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"blockHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"address\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"status\",\"type\":{\"type\":\"enum\",\"name\":\"ContractEventStatus\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\"]}},{\"name\":\"eventSpecificationSignature\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"networkName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}},{\"name\":\"retries\",\"type\":\"int\"}]}"); - - public static org.apache.avro.Schema getClassSchema() { - return SCHEMA$; - } - - private static SpecificData MODEL$ = new SpecificData(); - - private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); - - private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); - - /** - * Return the BinaryMessageEncoder instance used by this class. - * @return the message encoder used by this class - */ - public static BinaryMessageEncoder getEncoder() { - return ENCODER; - } - - /** - * Return the BinaryMessageDecoder instance used by this class. - * @return the message decoder used by this class - */ - public static BinaryMessageDecoder getDecoder() { - return DECODER; - } - - /** - * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}. - * @param resolver a {@link SchemaStore} used to find schemas by fingerprint - * @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore - */ - public static BinaryMessageDecoder createDecoder(SchemaStore resolver) { - return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver); - } - - /** - * Serializes this ContractEvent to a ByteBuffer. - * @return a buffer holding the serialized data for this instance - * @throws java.io.IOException if this instance could not be serialized - */ - public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { - return ENCODER.encode(this); - } - - /** - * Deserializes a ContractEvent from a ByteBuffer. - * @param b a byte buffer holding serialized data for an instance of this class - * @return a ContractEvent instance decoded from the given buffer - * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class - */ - public static ContractEvent fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { - return DECODER.decode(b); - } - - @Deprecated - public String id; - @Deprecated - public String type; - @Deprecated - public net.consensys.eventeum.ContractEventDetails details; - @Deprecated - public int retries; - - /** - * Default constructor. Note that this does not initialize fields - * to their default values from the schema. If that is desired then - * one should use newBuilder(). - */ - public ContractEvent() { - } - - /** - * All-args constructor. - * @param id The new value for id - * @param type The new value for type - * @param details The new value for details - * @param retries The new value for retries - */ - public ContractEvent(String id, String type, net.consensys.eventeum.ContractEventDetails details, Integer retries) { - this.id = id; - this.type = type; - this.details = details; - this.retries = retries; - } - - public org.apache.avro.specific.SpecificData getSpecificData() { - return MODEL$; - } - - public org.apache.avro.Schema getSchema() { - return SCHEMA$; - } - - // Used by DatumWriter. Applications should not call. - public Object get(int field$) { - switch (field$) { - case 0: - return id; - case 1: - return type; - case 2: - return details; - case 3: - return retries; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - // Used by DatumReader. Applications should not call. - @SuppressWarnings(value = "unchecked") - public void put(int field$, Object value$) { - switch (field$) { - case 0: - id = (String) value$; - break; - case 1: - type = (String) value$; - break; - case 2: - details = (net.consensys.eventeum.ContractEventDetails) value$; - break; - case 3: - retries = (Integer) value$; - break; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - /** - * Gets the value of the 'id' field. - * @return The value of the 'id' field. - */ - public String getId() { - return id; - } - - - /** - * Sets the value of the 'id' field. - * @param value the value to set. - */ - public void setId(String value) { - this.id = value; - } - - /** - * Gets the value of the 'type' field. - * @return The value of the 'type' field. - */ - public String getType() { - return type; - } - - - /** - * Sets the value of the 'type' field. - * @param value the value to set. - */ - public void setType(String value) { - this.type = value; - } - - /** - * Gets the value of the 'details' field. - * @return The value of the 'details' field. - */ - public net.consensys.eventeum.ContractEventDetails getDetails() { - return details; - } - - - /** - * Sets the value of the 'details' field. - * @param value the value to set. - */ - public void setDetails(net.consensys.eventeum.ContractEventDetails value) { - this.details = value; - } - - /** - * Gets the value of the 'retries' field. - * @return The value of the 'retries' field. - */ - public int getRetries() { - return retries; - } - - - /** - * Sets the value of the 'retries' field. - * @param value the value to set. - */ - public void setRetries(int value) { - this.retries = value; - } - - /** - * Creates a new ContractEvent RecordBuilder. - * @return A new ContractEvent RecordBuilder - */ - public static net.consensys.eventeum.ContractEvent.Builder newBuilder() { - return new net.consensys.eventeum.ContractEvent.Builder(); - } - - /** - * Creates a new ContractEvent RecordBuilder by copying an existing Builder. - * @param other The existing builder to copy. - * @return A new ContractEvent RecordBuilder - */ - public static net.consensys.eventeum.ContractEvent.Builder newBuilder(net.consensys.eventeum.ContractEvent.Builder other) { - if (other == null) { - return new net.consensys.eventeum.ContractEvent.Builder(); - } else { - return new net.consensys.eventeum.ContractEvent.Builder(other); - } - } - - /** - * Creates a new ContractEvent RecordBuilder by copying an existing ContractEvent instance. - * @param other The existing instance to copy. - * @return A new ContractEvent RecordBuilder - */ - public static net.consensys.eventeum.ContractEvent.Builder newBuilder(net.consensys.eventeum.ContractEvent other) { - if (other == null) { - return new net.consensys.eventeum.ContractEvent.Builder(); - } else { - return new net.consensys.eventeum.ContractEvent.Builder(other); - } - } - - /** - * RecordBuilder for ContractEvent instances. - */ - public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase - implements org.apache.avro.data.RecordBuilder { - - private String id; - private String type; - private net.consensys.eventeum.ContractEventDetails details; - private net.consensys.eventeum.ContractEventDetails.Builder detailsBuilder; - private int retries; - - /** Creates a new Builder */ - private Builder() { - super(SCHEMA$); - } - - /** - * Creates a Builder by copying an existing Builder. - * @param other The existing Builder to copy. - */ - private Builder(net.consensys.eventeum.ContractEvent.Builder other) { - super(other); - if (isValidValue(fields()[0], other.id)) { - this.id = data().deepCopy(fields()[0].schema(), other.id); - fieldSetFlags()[0] = other.fieldSetFlags()[0]; - } - if (isValidValue(fields()[1], other.type)) { - this.type = data().deepCopy(fields()[1].schema(), other.type); - fieldSetFlags()[1] = other.fieldSetFlags()[1]; - } - if (isValidValue(fields()[2], other.details)) { - this.details = data().deepCopy(fields()[2].schema(), other.details); - fieldSetFlags()[2] = other.fieldSetFlags()[2]; - } - if (other.hasDetailsBuilder()) { - this.detailsBuilder = net.consensys.eventeum.ContractEventDetails.newBuilder(other.getDetailsBuilder()); - } - if (isValidValue(fields()[3], other.retries)) { - this.retries = data().deepCopy(fields()[3].schema(), other.retries); - fieldSetFlags()[3] = other.fieldSetFlags()[3]; - } - } - - /** - * Creates a Builder by copying an existing ContractEvent instance - * @param other The existing instance to copy. - */ - private Builder(net.consensys.eventeum.ContractEvent other) { - super(SCHEMA$); - if (isValidValue(fields()[0], other.id)) { - this.id = data().deepCopy(fields()[0].schema(), other.id); - fieldSetFlags()[0] = true; - } - if (isValidValue(fields()[1], other.type)) { - this.type = data().deepCopy(fields()[1].schema(), other.type); - fieldSetFlags()[1] = true; - } - if (isValidValue(fields()[2], other.details)) { - this.details = data().deepCopy(fields()[2].schema(), other.details); - fieldSetFlags()[2] = true; - } - this.detailsBuilder = null; - if (isValidValue(fields()[3], other.retries)) { - this.retries = data().deepCopy(fields()[3].schema(), other.retries); - fieldSetFlags()[3] = true; - } - } - - /** - * Gets the value of the 'id' field. - * @return The value. - */ - public String getId() { - return id; - } - - - /** - * Sets the value of the 'id' field. - * @param value The value of 'id'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEvent.Builder setId(String value) { - validate(fields()[0], value); - this.id = value; - fieldSetFlags()[0] = true; - return this; - } - - /** - * Checks whether the 'id' field has been set. - * @return True if the 'id' field has been set, false otherwise. - */ - public boolean hasId() { - return fieldSetFlags()[0]; - } - - - /** - * Clears the value of the 'id' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEvent.Builder clearId() { - id = null; - fieldSetFlags()[0] = false; - return this; - } - - /** - * Gets the value of the 'type' field. - * @return The value. - */ - public String getType() { - return type; - } - - - /** - * Sets the value of the 'type' field. - * @param value The value of 'type'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEvent.Builder setType(String value) { - validate(fields()[1], value); - this.type = value; - fieldSetFlags()[1] = true; - return this; - } - - /** - * Checks whether the 'type' field has been set. - * @return True if the 'type' field has been set, false otherwise. - */ - public boolean hasType() { - return fieldSetFlags()[1]; - } - - - /** - * Clears the value of the 'type' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEvent.Builder clearType() { - type = null; - fieldSetFlags()[1] = false; - return this; - } - - /** - * Gets the value of the 'details' field. - * @return The value. - */ - public net.consensys.eventeum.ContractEventDetails getDetails() { - return details; - } - - - /** - * Sets the value of the 'details' field. - * @param value The value of 'details'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEvent.Builder setDetails(net.consensys.eventeum.ContractEventDetails value) { - validate(fields()[2], value); - this.detailsBuilder = null; - this.details = value; - fieldSetFlags()[2] = true; - return this; - } - - /** - * Checks whether the 'details' field has been set. - * @return True if the 'details' field has been set, false otherwise. - */ - public boolean hasDetails() { - return fieldSetFlags()[2]; - } - - /** - * Gets the Builder instance for the 'details' field and creates one if it doesn't exist yet. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder getDetailsBuilder() { - if (detailsBuilder == null) { - if (hasDetails()) { - setDetailsBuilder(net.consensys.eventeum.ContractEventDetails.newBuilder(details)); - } else { - setDetailsBuilder(net.consensys.eventeum.ContractEventDetails.newBuilder()); - } - } - return detailsBuilder; - } - - /** - * Sets the Builder instance for the 'details' field - * @param value The builder instance that must be set. - * @return This builder. - */ - public net.consensys.eventeum.ContractEvent.Builder setDetailsBuilder(net.consensys.eventeum.ContractEventDetails.Builder value) { - clearDetails(); - detailsBuilder = value; - return this; - } - - /** - * Checks whether the 'details' field has an active Builder instance - * @return True if the 'details' field has an active Builder instance - */ - public boolean hasDetailsBuilder() { - return detailsBuilder != null; - } - - /** - * Clears the value of the 'details' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEvent.Builder clearDetails() { - details = null; - detailsBuilder = null; - fieldSetFlags()[2] = false; - return this; - } - - /** - * Gets the value of the 'retries' field. - * @return The value. - */ - public int getRetries() { - return retries; - } - - - /** - * Sets the value of the 'retries' field. - * @param value The value of 'retries'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEvent.Builder setRetries(int value) { - validate(fields()[3], value); - this.retries = value; - fieldSetFlags()[3] = true; - return this; - } - - /** - * Checks whether the 'retries' field has been set. - * @return True if the 'retries' field has been set, false otherwise. - */ - public boolean hasRetries() { - return fieldSetFlags()[3]; - } - - - /** - * Clears the value of the 'retries' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEvent.Builder clearRetries() { - fieldSetFlags()[3] = false; - return this; - } - - @Override - @SuppressWarnings("unchecked") - public ContractEvent build() { - try { - ContractEvent record = new ContractEvent(); - record.id = fieldSetFlags()[0] ? this.id : (String) defaultValue(fields()[0]); - record.type = fieldSetFlags()[1] ? this.type : (String) defaultValue(fields()[1]); - if (detailsBuilder != null) { - try { - record.details = this.detailsBuilder.build(); - } catch (org.apache.avro.AvroMissingFieldException e) { - e.addParentField(record.getSchema().getField("details")); - throw e; - } - } else { - record.details = fieldSetFlags()[2] ? this.details : (net.consensys.eventeum.ContractEventDetails) defaultValue(fields()[2]); - } - record.retries = fieldSetFlags()[3] ? this.retries : (Integer) defaultValue(fields()[3]); - return record; - } catch (org.apache.avro.AvroMissingFieldException e) { - throw e; - } catch (Exception e) { - throw new org.apache.avro.AvroRuntimeException(e); - } - } - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter) MODEL$.createDatumWriter(SCHEMA$); - - @Override - public void writeExternal(java.io.ObjectOutput out) - throws java.io.IOException { - WRITER$.write(this, SpecificData.getEncoder(out)); - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader) MODEL$.createDatumReader(SCHEMA$); - - @Override - public void readExternal(java.io.ObjectInput in) - throws java.io.IOException { - READER$.read(this, SpecificData.getDecoder(in)); - } - -} - - - - - - - - - - diff --git a/src/main/java/net/consensys/eventeum/ContractEventDetails.java b/src/main/java/net/consensys/eventeum/ContractEventDetails.java deleted file mode 100644 index b4e8bc1..0000000 --- a/src/main/java/net/consensys/eventeum/ContractEventDetails.java +++ /dev/null @@ -1,1285 +0,0 @@ -/** - * Autogenerated by Avro - *

- * DO NOT EDIT DIRECTLY - */ -package net.consensys.eventeum; - -import org.apache.avro.message.BinaryMessageDecoder; -import org.apache.avro.message.BinaryMessageEncoder; -import org.apache.avro.message.SchemaStore; -import org.apache.avro.specific.SpecificData; - -@org.apache.avro.specific.AvroGenerated -public class ContractEventDetails extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = -3223974792905382143L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"ContractEventDetails\",\"namespace\":\"net.consensys.eventeum\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"filterId\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"indexedParameters\",\"type\":{\"type\":\"array\",\"items\":[{\"type\":\"record\",\"name\":\"StringParameter\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]},{\"type\":\"record\",\"name\":\"NumberParameter\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"}]}]}},{\"name\":\"nonIndexedParameters\",\"type\":{\"type\":\"array\",\"items\":[\"StringParameter\",\"NumberParameter\"]}},{\"name\":\"transactionHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"logIndex\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"blockNumber\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"blockHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"address\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"status\",\"type\":{\"type\":\"enum\",\"name\":\"ContractEventStatus\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\"]}},{\"name\":\"eventSpecificationSignature\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"networkName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}"); - - public static org.apache.avro.Schema getClassSchema() { - return SCHEMA$; - } - - private static SpecificData MODEL$ = new SpecificData(); - - private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); - - private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); - - /** - * Return the BinaryMessageEncoder instance used by this class. - * @return the message encoder used by this class - */ - public static BinaryMessageEncoder getEncoder() { - return ENCODER; - } - - /** - * Return the BinaryMessageDecoder instance used by this class. - * @return the message decoder used by this class - */ - public static BinaryMessageDecoder getDecoder() { - return DECODER; - } - - /** - * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}. - * @param resolver a {@link SchemaStore} used to find schemas by fingerprint - * @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore - */ - public static BinaryMessageDecoder createDecoder(SchemaStore resolver) { - return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver); - } - - /** - * Serializes this ContractEventDetails to a ByteBuffer. - * @return a buffer holding the serialized data for this instance - * @throws java.io.IOException if this instance could not be serialized - */ - public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { - return ENCODER.encode(this); - } - - /** - * Deserializes a ContractEventDetails from a ByteBuffer. - * @param b a byte buffer holding serialized data for an instance of this class - * @return a ContractEventDetails instance decoded from the given buffer - * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class - */ - public static ContractEventDetails fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { - return DECODER.decode(b); - } - - @Deprecated - public String name; - @Deprecated - public String filterId; - @Deprecated - public String nodeName; - @Deprecated - public java.util.List indexedParameters; - @Deprecated - public java.util.List nonIndexedParameters; - @Deprecated - public String transactionHash; - @Deprecated - public String logIndex; - @Deprecated - public String blockNumber; - @Deprecated - public String blockHash; - @Deprecated - public String address; - @Deprecated - public net.consensys.eventeum.ContractEventStatus status; - @Deprecated - public String eventSpecificationSignature; - @Deprecated - public String networkName; - @Deprecated - public String id; - - /** - * Default constructor. Note that this does not initialize fields - * to their default values from the schema. If that is desired then - * one should use newBuilder(). - */ - public ContractEventDetails() { - } - - /** - * All-args constructor. - * @param name The new value for name - * @param filterId The new value for filterId - * @param nodeName The new value for nodeName - * @param indexedParameters The new value for indexedParameters - * @param nonIndexedParameters The new value for nonIndexedParameters - * @param transactionHash The new value for transactionHash - * @param logIndex The new value for logIndex - * @param blockNumber The new value for blockNumber - * @param blockHash The new value for blockHash - * @param address The new value for address - * @param status The new value for status - * @param eventSpecificationSignature The new value for eventSpecificationSignature - * @param networkName The new value for networkName - * @param id The new value for id - */ - public ContractEventDetails(String name, String filterId, String nodeName, java.util.List indexedParameters, java.util.List nonIndexedParameters, String transactionHash, String logIndex, String blockNumber, String blockHash, String address, net.consensys.eventeum.ContractEventStatus status, String eventSpecificationSignature, String networkName, String id) { - this.name = name; - this.filterId = filterId; - this.nodeName = nodeName; - this.indexedParameters = indexedParameters; - this.nonIndexedParameters = nonIndexedParameters; - this.transactionHash = transactionHash; - this.logIndex = logIndex; - this.blockNumber = blockNumber; - this.blockHash = blockHash; - this.address = address; - this.status = status; - this.eventSpecificationSignature = eventSpecificationSignature; - this.networkName = networkName; - this.id = id; - } - - public org.apache.avro.specific.SpecificData getSpecificData() { - return MODEL$; - } - - public org.apache.avro.Schema getSchema() { - return SCHEMA$; - } - - // Used by DatumWriter. Applications should not call. - public Object get(int field$) { - switch (field$) { - case 0: - return name; - case 1: - return filterId; - case 2: - return nodeName; - case 3: - return indexedParameters; - case 4: - return nonIndexedParameters; - case 5: - return transactionHash; - case 6: - return logIndex; - case 7: - return blockNumber; - case 8: - return blockHash; - case 9: - return address; - case 10: - return status; - case 11: - return eventSpecificationSignature; - case 12: - return networkName; - case 13: - return id; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - // Used by DatumReader. Applications should not call. - @SuppressWarnings(value = "unchecked") - public void put(int field$, Object value$) { - switch (field$) { - case 0: - name = (String) value$; - break; - case 1: - filterId = (String) value$; - break; - case 2: - nodeName = (String) value$; - break; - case 3: - indexedParameters = (java.util.List) value$; - break; - case 4: - nonIndexedParameters = (java.util.List) value$; - break; - case 5: - transactionHash = (String) value$; - break; - case 6: - logIndex = (String) value$; - break; - case 7: - blockNumber = (String) value$; - break; - case 8: - blockHash = (String) value$; - break; - case 9: - address = (String) value$; - break; - case 10: - status = (net.consensys.eventeum.ContractEventStatus) value$; - break; - case 11: - eventSpecificationSignature = (String) value$; - break; - case 12: - networkName = (String) value$; - break; - case 13: - id = (String) value$; - break; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - /** - * Gets the value of the 'name' field. - * @return The value of the 'name' field. - */ - public String getName() { - return name; - } - - - /** - * Sets the value of the 'name' field. - * @param value the value to set. - */ - public void setName(String value) { - this.name = value; - } - - /** - * Gets the value of the 'filterId' field. - * @return The value of the 'filterId' field. - */ - public String getFilterId() { - return filterId; - } - - - /** - * Sets the value of the 'filterId' field. - * @param value the value to set. - */ - public void setFilterId(String value) { - this.filterId = value; - } - - /** - * Gets the value of the 'nodeName' field. - * @return The value of the 'nodeName' field. - */ - public String getNodeName() { - return nodeName; - } - - - /** - * Sets the value of the 'nodeName' field. - * @param value the value to set. - */ - public void setNodeName(String value) { - this.nodeName = value; - } - - /** - * Gets the value of the 'indexedParameters' field. - * @return The value of the 'indexedParameters' field. - */ - public java.util.List getIndexedParameters() { - return indexedParameters; - } - - - /** - * Sets the value of the 'indexedParameters' field. - * @param value the value to set. - */ - public void setIndexedParameters(java.util.List value) { - this.indexedParameters = value; - } - - /** - * Gets the value of the 'nonIndexedParameters' field. - * @return The value of the 'nonIndexedParameters' field. - */ - public java.util.List getNonIndexedParameters() { - return nonIndexedParameters; - } - - - /** - * Sets the value of the 'nonIndexedParameters' field. - * @param value the value to set. - */ - public void setNonIndexedParameters(java.util.List value) { - this.nonIndexedParameters = value; - } - - /** - * Gets the value of the 'transactionHash' field. - * @return The value of the 'transactionHash' field. - */ - public String getTransactionHash() { - return transactionHash; - } - - - /** - * Sets the value of the 'transactionHash' field. - * @param value the value to set. - */ - public void setTransactionHash(String value) { - this.transactionHash = value; - } - - /** - * Gets the value of the 'logIndex' field. - * @return The value of the 'logIndex' field. - */ - public String getLogIndex() { - return logIndex; - } - - - /** - * Sets the value of the 'logIndex' field. - * @param value the value to set. - */ - public void setLogIndex(String value) { - this.logIndex = value; - } - - /** - * Gets the value of the 'blockNumber' field. - * @return The value of the 'blockNumber' field. - */ - public String getBlockNumber() { - return blockNumber; - } - - - /** - * Sets the value of the 'blockNumber' field. - * @param value the value to set. - */ - public void setBlockNumber(String value) { - this.blockNumber = value; - } - - /** - * Gets the value of the 'blockHash' field. - * @return The value of the 'blockHash' field. - */ - public String getBlockHash() { - return blockHash; - } - - - /** - * Sets the value of the 'blockHash' field. - * @param value the value to set. - */ - public void setBlockHash(String value) { - this.blockHash = value; - } - - /** - * Gets the value of the 'address' field. - * @return The value of the 'address' field. - */ - public String getAddress() { - return address; - } - - - /** - * Sets the value of the 'address' field. - * @param value the value to set. - */ - public void setAddress(String value) { - this.address = value; - } - - /** - * Gets the value of the 'status' field. - * @return The value of the 'status' field. - */ - public net.consensys.eventeum.ContractEventStatus getStatus() { - return status; - } - - - /** - * Sets the value of the 'status' field. - * @param value the value to set. - */ - public void setStatus(net.consensys.eventeum.ContractEventStatus value) { - this.status = value; - } - - /** - * Gets the value of the 'eventSpecificationSignature' field. - * @return The value of the 'eventSpecificationSignature' field. - */ - public String getEventSpecificationSignature() { - return eventSpecificationSignature; - } - - - /** - * Sets the value of the 'eventSpecificationSignature' field. - * @param value the value to set. - */ - public void setEventSpecificationSignature(String value) { - this.eventSpecificationSignature = value; - } - - /** - * Gets the value of the 'networkName' field. - * @return The value of the 'networkName' field. - */ - public String getNetworkName() { - return networkName; - } - - - /** - * Sets the value of the 'networkName' field. - * @param value the value to set. - */ - public void setNetworkName(String value) { - this.networkName = value; - } - - /** - * Gets the value of the 'id' field. - * @return The value of the 'id' field. - */ - public String getId() { - return id; - } - - - /** - * Sets the value of the 'id' field. - * @param value the value to set. - */ - public void setId(String value) { - this.id = value; - } - - /** - * Creates a new ContractEventDetails RecordBuilder. - * @return A new ContractEventDetails RecordBuilder - */ - public static net.consensys.eventeum.ContractEventDetails.Builder newBuilder() { - return new net.consensys.eventeum.ContractEventDetails.Builder(); - } - - /** - * Creates a new ContractEventDetails RecordBuilder by copying an existing Builder. - * @param other The existing builder to copy. - * @return A new ContractEventDetails RecordBuilder - */ - public static net.consensys.eventeum.ContractEventDetails.Builder newBuilder(net.consensys.eventeum.ContractEventDetails.Builder other) { - if (other == null) { - return new net.consensys.eventeum.ContractEventDetails.Builder(); - } else { - return new net.consensys.eventeum.ContractEventDetails.Builder(other); - } - } - - /** - * Creates a new ContractEventDetails RecordBuilder by copying an existing ContractEventDetails instance. - * @param other The existing instance to copy. - * @return A new ContractEventDetails RecordBuilder - */ - public static net.consensys.eventeum.ContractEventDetails.Builder newBuilder(net.consensys.eventeum.ContractEventDetails other) { - if (other == null) { - return new net.consensys.eventeum.ContractEventDetails.Builder(); - } else { - return new net.consensys.eventeum.ContractEventDetails.Builder(other); - } - } - - /** - * RecordBuilder for ContractEventDetails instances. - */ - public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase - implements org.apache.avro.data.RecordBuilder { - - private String name; - private String filterId; - private String nodeName; - private java.util.List indexedParameters; - private java.util.List nonIndexedParameters; - private String transactionHash; - private String logIndex; - private String blockNumber; - private String blockHash; - private String address; - private net.consensys.eventeum.ContractEventStatus status; - private String eventSpecificationSignature; - private String networkName; - private String id; - - /** Creates a new Builder */ - private Builder() { - super(SCHEMA$); - } - - /** - * Creates a Builder by copying an existing Builder. - * @param other The existing Builder to copy. - */ - private Builder(net.consensys.eventeum.ContractEventDetails.Builder other) { - super(other); - if (isValidValue(fields()[0], other.name)) { - this.name = data().deepCopy(fields()[0].schema(), other.name); - fieldSetFlags()[0] = other.fieldSetFlags()[0]; - } - if (isValidValue(fields()[1], other.filterId)) { - this.filterId = data().deepCopy(fields()[1].schema(), other.filterId); - fieldSetFlags()[1] = other.fieldSetFlags()[1]; - } - if (isValidValue(fields()[2], other.nodeName)) { - this.nodeName = data().deepCopy(fields()[2].schema(), other.nodeName); - fieldSetFlags()[2] = other.fieldSetFlags()[2]; - } - if (isValidValue(fields()[3], other.indexedParameters)) { - this.indexedParameters = data().deepCopy(fields()[3].schema(), other.indexedParameters); - fieldSetFlags()[3] = other.fieldSetFlags()[3]; - } - if (isValidValue(fields()[4], other.nonIndexedParameters)) { - this.nonIndexedParameters = data().deepCopy(fields()[4].schema(), other.nonIndexedParameters); - fieldSetFlags()[4] = other.fieldSetFlags()[4]; - } - if (isValidValue(fields()[5], other.transactionHash)) { - this.transactionHash = data().deepCopy(fields()[5].schema(), other.transactionHash); - fieldSetFlags()[5] = other.fieldSetFlags()[5]; - } - if (isValidValue(fields()[6], other.logIndex)) { - this.logIndex = data().deepCopy(fields()[6].schema(), other.logIndex); - fieldSetFlags()[6] = other.fieldSetFlags()[6]; - } - if (isValidValue(fields()[7], other.blockNumber)) { - this.blockNumber = data().deepCopy(fields()[7].schema(), other.blockNumber); - fieldSetFlags()[7] = other.fieldSetFlags()[7]; - } - if (isValidValue(fields()[8], other.blockHash)) { - this.blockHash = data().deepCopy(fields()[8].schema(), other.blockHash); - fieldSetFlags()[8] = other.fieldSetFlags()[8]; - } - if (isValidValue(fields()[9], other.address)) { - this.address = data().deepCopy(fields()[9].schema(), other.address); - fieldSetFlags()[9] = other.fieldSetFlags()[9]; - } - if (isValidValue(fields()[10], other.status)) { - this.status = data().deepCopy(fields()[10].schema(), other.status); - fieldSetFlags()[10] = other.fieldSetFlags()[10]; - } - if (isValidValue(fields()[11], other.eventSpecificationSignature)) { - this.eventSpecificationSignature = data().deepCopy(fields()[11].schema(), other.eventSpecificationSignature); - fieldSetFlags()[11] = other.fieldSetFlags()[11]; - } - if (isValidValue(fields()[12], other.networkName)) { - this.networkName = data().deepCopy(fields()[12].schema(), other.networkName); - fieldSetFlags()[12] = other.fieldSetFlags()[12]; - } - if (isValidValue(fields()[13], other.id)) { - this.id = data().deepCopy(fields()[13].schema(), other.id); - fieldSetFlags()[13] = other.fieldSetFlags()[13]; - } - } - - /** - * Creates a Builder by copying an existing ContractEventDetails instance - * @param other The existing instance to copy. - */ - private Builder(net.consensys.eventeum.ContractEventDetails other) { - super(SCHEMA$); - if (isValidValue(fields()[0], other.name)) { - this.name = data().deepCopy(fields()[0].schema(), other.name); - fieldSetFlags()[0] = true; - } - if (isValidValue(fields()[1], other.filterId)) { - this.filterId = data().deepCopy(fields()[1].schema(), other.filterId); - fieldSetFlags()[1] = true; - } - if (isValidValue(fields()[2], other.nodeName)) { - this.nodeName = data().deepCopy(fields()[2].schema(), other.nodeName); - fieldSetFlags()[2] = true; - } - if (isValidValue(fields()[3], other.indexedParameters)) { - this.indexedParameters = data().deepCopy(fields()[3].schema(), other.indexedParameters); - fieldSetFlags()[3] = true; - } - if (isValidValue(fields()[4], other.nonIndexedParameters)) { - this.nonIndexedParameters = data().deepCopy(fields()[4].schema(), other.nonIndexedParameters); - fieldSetFlags()[4] = true; - } - if (isValidValue(fields()[5], other.transactionHash)) { - this.transactionHash = data().deepCopy(fields()[5].schema(), other.transactionHash); - fieldSetFlags()[5] = true; - } - if (isValidValue(fields()[6], other.logIndex)) { - this.logIndex = data().deepCopy(fields()[6].schema(), other.logIndex); - fieldSetFlags()[6] = true; - } - if (isValidValue(fields()[7], other.blockNumber)) { - this.blockNumber = data().deepCopy(fields()[7].schema(), other.blockNumber); - fieldSetFlags()[7] = true; - } - if (isValidValue(fields()[8], other.blockHash)) { - this.blockHash = data().deepCopy(fields()[8].schema(), other.blockHash); - fieldSetFlags()[8] = true; - } - if (isValidValue(fields()[9], other.address)) { - this.address = data().deepCopy(fields()[9].schema(), other.address); - fieldSetFlags()[9] = true; - } - if (isValidValue(fields()[10], other.status)) { - this.status = data().deepCopy(fields()[10].schema(), other.status); - fieldSetFlags()[10] = true; - } - if (isValidValue(fields()[11], other.eventSpecificationSignature)) { - this.eventSpecificationSignature = data().deepCopy(fields()[11].schema(), other.eventSpecificationSignature); - fieldSetFlags()[11] = true; - } - if (isValidValue(fields()[12], other.networkName)) { - this.networkName = data().deepCopy(fields()[12].schema(), other.networkName); - fieldSetFlags()[12] = true; - } - if (isValidValue(fields()[13], other.id)) { - this.id = data().deepCopy(fields()[13].schema(), other.id); - fieldSetFlags()[13] = true; - } - } - - /** - * Gets the value of the 'name' field. - * @return The value. - */ - public String getName() { - return name; - } - - - /** - * Sets the value of the 'name' field. - * @param value The value of 'name'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setName(String value) { - validate(fields()[0], value); - this.name = value; - fieldSetFlags()[0] = true; - return this; - } - - /** - * Checks whether the 'name' field has been set. - * @return True if the 'name' field has been set, false otherwise. - */ - public boolean hasName() { - return fieldSetFlags()[0]; - } - - - /** - * Clears the value of the 'name' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearName() { - name = null; - fieldSetFlags()[0] = false; - return this; - } - - /** - * Gets the value of the 'filterId' field. - * @return The value. - */ - public String getFilterId() { - return filterId; - } - - - /** - * Sets the value of the 'filterId' field. - * @param value The value of 'filterId'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setFilterId(String value) { - validate(fields()[1], value); - this.filterId = value; - fieldSetFlags()[1] = true; - return this; - } - - /** - * Checks whether the 'filterId' field has been set. - * @return True if the 'filterId' field has been set, false otherwise. - */ - public boolean hasFilterId() { - return fieldSetFlags()[1]; - } - - - /** - * Clears the value of the 'filterId' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearFilterId() { - filterId = null; - fieldSetFlags()[1] = false; - return this; - } - - /** - * Gets the value of the 'nodeName' field. - * @return The value. - */ - public String getNodeName() { - return nodeName; - } - - - /** - * Sets the value of the 'nodeName' field. - * @param value The value of 'nodeName'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setNodeName(String value) { - validate(fields()[2], value); - this.nodeName = value; - fieldSetFlags()[2] = true; - return this; - } - - /** - * Checks whether the 'nodeName' field has been set. - * @return True if the 'nodeName' field has been set, false otherwise. - */ - public boolean hasNodeName() { - return fieldSetFlags()[2]; - } - - - /** - * Clears the value of the 'nodeName' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearNodeName() { - nodeName = null; - fieldSetFlags()[2] = false; - return this; - } - - /** - * Gets the value of the 'indexedParameters' field. - * @return The value. - */ - public java.util.List getIndexedParameters() { - return indexedParameters; - } - - - /** - * Sets the value of the 'indexedParameters' field. - * @param value The value of 'indexedParameters'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setIndexedParameters(java.util.List value) { - validate(fields()[3], value); - this.indexedParameters = value; - fieldSetFlags()[3] = true; - return this; - } - - /** - * Checks whether the 'indexedParameters' field has been set. - * @return True if the 'indexedParameters' field has been set, false otherwise. - */ - public boolean hasIndexedParameters() { - return fieldSetFlags()[3]; - } - - - /** - * Clears the value of the 'indexedParameters' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearIndexedParameters() { - indexedParameters = null; - fieldSetFlags()[3] = false; - return this; - } - - /** - * Gets the value of the 'nonIndexedParameters' field. - * @return The value. - */ - public java.util.List getNonIndexedParameters() { - return nonIndexedParameters; - } - - - /** - * Sets the value of the 'nonIndexedParameters' field. - * @param value The value of 'nonIndexedParameters'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setNonIndexedParameters(java.util.List value) { - validate(fields()[4], value); - this.nonIndexedParameters = value; - fieldSetFlags()[4] = true; - return this; - } - - /** - * Checks whether the 'nonIndexedParameters' field has been set. - * @return True if the 'nonIndexedParameters' field has been set, false otherwise. - */ - public boolean hasNonIndexedParameters() { - return fieldSetFlags()[4]; - } - - - /** - * Clears the value of the 'nonIndexedParameters' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearNonIndexedParameters() { - nonIndexedParameters = null; - fieldSetFlags()[4] = false; - return this; - } - - /** - * Gets the value of the 'transactionHash' field. - * @return The value. - */ - public String getTransactionHash() { - return transactionHash; - } - - - /** - * Sets the value of the 'transactionHash' field. - * @param value The value of 'transactionHash'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setTransactionHash(String value) { - validate(fields()[5], value); - this.transactionHash = value; - fieldSetFlags()[5] = true; - return this; - } - - /** - * Checks whether the 'transactionHash' field has been set. - * @return True if the 'transactionHash' field has been set, false otherwise. - */ - public boolean hasTransactionHash() { - return fieldSetFlags()[5]; - } - - - /** - * Clears the value of the 'transactionHash' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearTransactionHash() { - transactionHash = null; - fieldSetFlags()[5] = false; - return this; - } - - /** - * Gets the value of the 'logIndex' field. - * @return The value. - */ - public String getLogIndex() { - return logIndex; - } - - - /** - * Sets the value of the 'logIndex' field. - * @param value The value of 'logIndex'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setLogIndex(String value) { - validate(fields()[6], value); - this.logIndex = value; - fieldSetFlags()[6] = true; - return this; - } - - /** - * Checks whether the 'logIndex' field has been set. - * @return True if the 'logIndex' field has been set, false otherwise. - */ - public boolean hasLogIndex() { - return fieldSetFlags()[6]; - } - - - /** - * Clears the value of the 'logIndex' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearLogIndex() { - logIndex = null; - fieldSetFlags()[6] = false; - return this; - } - - /** - * Gets the value of the 'blockNumber' field. - * @return The value. - */ - public String getBlockNumber() { - return blockNumber; - } - - - /** - * Sets the value of the 'blockNumber' field. - * @param value The value of 'blockNumber'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setBlockNumber(String value) { - validate(fields()[7], value); - this.blockNumber = value; - fieldSetFlags()[7] = true; - return this; - } - - /** - * Checks whether the 'blockNumber' field has been set. - * @return True if the 'blockNumber' field has been set, false otherwise. - */ - public boolean hasBlockNumber() { - return fieldSetFlags()[7]; - } - - - /** - * Clears the value of the 'blockNumber' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearBlockNumber() { - blockNumber = null; - fieldSetFlags()[7] = false; - return this; - } - - /** - * Gets the value of the 'blockHash' field. - * @return The value. - */ - public String getBlockHash() { - return blockHash; - } - - - /** - * Sets the value of the 'blockHash' field. - * @param value The value of 'blockHash'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setBlockHash(String value) { - validate(fields()[8], value); - this.blockHash = value; - fieldSetFlags()[8] = true; - return this; - } - - /** - * Checks whether the 'blockHash' field has been set. - * @return True if the 'blockHash' field has been set, false otherwise. - */ - public boolean hasBlockHash() { - return fieldSetFlags()[8]; - } - - - /** - * Clears the value of the 'blockHash' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearBlockHash() { - blockHash = null; - fieldSetFlags()[8] = false; - return this; - } - - /** - * Gets the value of the 'address' field. - * @return The value. - */ - public String getAddress() { - return address; - } - - - /** - * Sets the value of the 'address' field. - * @param value The value of 'address'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setAddress(String value) { - validate(fields()[9], value); - this.address = value; - fieldSetFlags()[9] = true; - return this; - } - - /** - * Checks whether the 'address' field has been set. - * @return True if the 'address' field has been set, false otherwise. - */ - public boolean hasAddress() { - return fieldSetFlags()[9]; - } - - - /** - * Clears the value of the 'address' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearAddress() { - address = null; - fieldSetFlags()[9] = false; - return this; - } - - /** - * Gets the value of the 'status' field. - * @return The value. - */ - public net.consensys.eventeum.ContractEventStatus getStatus() { - return status; - } - - - /** - * Sets the value of the 'status' field. - * @param value The value of 'status'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setStatus(net.consensys.eventeum.ContractEventStatus value) { - validate(fields()[10], value); - this.status = value; - fieldSetFlags()[10] = true; - return this; - } - - /** - * Checks whether the 'status' field has been set. - * @return True if the 'status' field has been set, false otherwise. - */ - public boolean hasStatus() { - return fieldSetFlags()[10]; - } - - - /** - * Clears the value of the 'status' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearStatus() { - status = null; - fieldSetFlags()[10] = false; - return this; - } - - /** - * Gets the value of the 'eventSpecificationSignature' field. - * @return The value. - */ - public String getEventSpecificationSignature() { - return eventSpecificationSignature; - } - - - /** - * Sets the value of the 'eventSpecificationSignature' field. - * @param value The value of 'eventSpecificationSignature'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setEventSpecificationSignature(String value) { - validate(fields()[11], value); - this.eventSpecificationSignature = value; - fieldSetFlags()[11] = true; - return this; - } - - /** - * Checks whether the 'eventSpecificationSignature' field has been set. - * @return True if the 'eventSpecificationSignature' field has been set, false otherwise. - */ - public boolean hasEventSpecificationSignature() { - return fieldSetFlags()[11]; - } - - - /** - * Clears the value of the 'eventSpecificationSignature' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearEventSpecificationSignature() { - eventSpecificationSignature = null; - fieldSetFlags()[11] = false; - return this; - } - - /** - * Gets the value of the 'networkName' field. - * @return The value. - */ - public String getNetworkName() { - return networkName; - } - - - /** - * Sets the value of the 'networkName' field. - * @param value The value of 'networkName'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setNetworkName(String value) { - validate(fields()[12], value); - this.networkName = value; - fieldSetFlags()[12] = true; - return this; - } - - /** - * Checks whether the 'networkName' field has been set. - * @return True if the 'networkName' field has been set, false otherwise. - */ - public boolean hasNetworkName() { - return fieldSetFlags()[12]; - } - - - /** - * Clears the value of the 'networkName' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearNetworkName() { - networkName = null; - fieldSetFlags()[12] = false; - return this; - } - - /** - * Gets the value of the 'id' field. - * @return The value. - */ - public String getId() { - return id; - } - - - /** - * Sets the value of the 'id' field. - * @param value The value of 'id'. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder setId(String value) { - validate(fields()[13], value); - this.id = value; - fieldSetFlags()[13] = true; - return this; - } - - /** - * Checks whether the 'id' field has been set. - * @return True if the 'id' field has been set, false otherwise. - */ - public boolean hasId() { - return fieldSetFlags()[13]; - } - - - /** - * Clears the value of the 'id' field. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder clearId() { - id = null; - fieldSetFlags()[13] = false; - return this; - } - - @Override - @SuppressWarnings("unchecked") - public ContractEventDetails build() { - try { - ContractEventDetails record = new ContractEventDetails(); - record.name = fieldSetFlags()[0] ? this.name : (String) defaultValue(fields()[0]); - record.filterId = fieldSetFlags()[1] ? this.filterId : (String) defaultValue(fields()[1]); - record.nodeName = fieldSetFlags()[2] ? this.nodeName : (String) defaultValue(fields()[2]); - record.indexedParameters = fieldSetFlags()[3] ? this.indexedParameters : (java.util.List) defaultValue(fields()[3]); - record.nonIndexedParameters = fieldSetFlags()[4] ? this.nonIndexedParameters : (java.util.List) defaultValue(fields()[4]); - record.transactionHash = fieldSetFlags()[5] ? this.transactionHash : (String) defaultValue(fields()[5]); - record.logIndex = fieldSetFlags()[6] ? this.logIndex : (String) defaultValue(fields()[6]); - record.blockNumber = fieldSetFlags()[7] ? this.blockNumber : (String) defaultValue(fields()[7]); - record.blockHash = fieldSetFlags()[8] ? this.blockHash : (String) defaultValue(fields()[8]); - record.address = fieldSetFlags()[9] ? this.address : (String) defaultValue(fields()[9]); - record.status = fieldSetFlags()[10] ? this.status : (net.consensys.eventeum.ContractEventStatus) defaultValue(fields()[10]); - record.eventSpecificationSignature = fieldSetFlags()[11] ? this.eventSpecificationSignature : (String) defaultValue(fields()[11]); - record.networkName = fieldSetFlags()[12] ? this.networkName : (String) defaultValue(fields()[12]); - record.id = fieldSetFlags()[13] ? this.id : (String) defaultValue(fields()[13]); - return record; - } catch (org.apache.avro.AvroMissingFieldException e) { - throw e; - } catch (Exception e) { - throw new org.apache.avro.AvroRuntimeException(e); - } - } - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter) MODEL$.createDatumWriter(SCHEMA$); - - @Override - public void writeExternal(java.io.ObjectOutput out) - throws java.io.IOException { - WRITER$.write(this, SpecificData.getEncoder(out)); - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader) MODEL$.createDatumReader(SCHEMA$); - - @Override - public void readExternal(java.io.ObjectInput in) - throws java.io.IOException { - READER$.read(this, SpecificData.getDecoder(in)); - } - -} - - - - - - - - - - diff --git a/src/main/java/net/consensys/eventeum/ContractEventStatus.java b/src/main/java/net/consensys/eventeum/ContractEventStatus.java deleted file mode 100644 index 84c1287..0000000 --- a/src/main/java/net/consensys/eventeum/ContractEventStatus.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Autogenerated by Avro - *

- * DO NOT EDIT DIRECTLY - */ -package net.consensys.eventeum; - -@org.apache.avro.specific.AvroGenerated -public enum ContractEventStatus implements org.apache.avro.generic.GenericEnumSymbol { - UNCONFIRMED, CONFIRMED, INVALIDATED; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"enum\",\"name\":\"ContractEventStatus\",\"namespace\":\"net.consensys.eventeum\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\"]}"); - - public static org.apache.avro.Schema getClassSchema() { - return SCHEMA$; - } - - public org.apache.avro.Schema getSchema() { - return SCHEMA$; - } -} diff --git a/src/main/java/net/consensys/eventeum/EventBlock.java b/src/main/java/net/consensys/eventeum/EventBlock.java deleted file mode 100644 index ac4af20..0000000 --- a/src/main/java/net/consensys/eventeum/EventBlock.java +++ /dev/null @@ -1,698 +0,0 @@ -/** - * Autogenerated by Avro - *

- * DO NOT EDIT DIRECTLY - */ -package net.consensys.eventeum; - -import org.apache.avro.message.BinaryMessageDecoder; -import org.apache.avro.message.BinaryMessageEncoder; -import org.apache.avro.message.SchemaStore; -import org.apache.avro.specific.SpecificData; - -@org.apache.avro.specific.AvroGenerated -public class EventBlock extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = -3360333280331309414L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"EventBlock\",\"namespace\":\"net.consensys.eventeum\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"details\",\"type\":{\"type\":\"record\",\"name\":\"ContractEventDetails\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"filterId\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"indexedParameters\",\"type\":{\"type\":\"array\",\"items\":[{\"type\":\"record\",\"name\":\"StringParameter\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]},{\"type\":\"record\",\"name\":\"NumberParameter\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"}]}]}},{\"name\":\"nonIndexedParameters\",\"type\":{\"type\":\"array\",\"items\":[\"StringParameter\",\"NumberParameter\"]}},{\"name\":\"transactionHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"logIndex\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"blockNumber\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"blockHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"address\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"status\",\"type\":{\"type\":\"enum\",\"name\":\"ContractEventStatus\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\"]}},{\"name\":\"eventSpecificationSignature\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"networkName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}},{\"name\":\"detailsBlock\",\"type\":{\"type\":\"record\",\"name\":\"BlockDetails\",\"fields\":[{\"name\":\"number\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"hash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"timestamp\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}},{\"name\":\"retries\",\"type\":\"int\"}]}"); - - public static org.apache.avro.Schema getClassSchema() { - return SCHEMA$; - } - - private static SpecificData MODEL$ = new SpecificData(); - - private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); - - private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); - - /** - * Return the BinaryMessageEncoder instance used by this class. - * @return the message encoder used by this class - */ - public static BinaryMessageEncoder getEncoder() { - return ENCODER; - } - - /** - * Return the BinaryMessageDecoder instance used by this class. - * @return the message decoder used by this class - */ - public static BinaryMessageDecoder getDecoder() { - return DECODER; - } - - /** - * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}. - * @param resolver a {@link SchemaStore} used to find schemas by fingerprint - * @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore - */ - public static BinaryMessageDecoder createDecoder(SchemaStore resolver) { - return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver); - } - - /** - * Serializes this EventBlock to a ByteBuffer. - * @return a buffer holding the serialized data for this instance - * @throws java.io.IOException if this instance could not be serialized - */ - public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { - return ENCODER.encode(this); - } - - /** - * Deserializes a EventBlock from a ByteBuffer. - * @param b a byte buffer holding serialized data for an instance of this class - * @return a EventBlock instance decoded from the given buffer - * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class - */ - public static EventBlock fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { - return DECODER.decode(b); - } - - @Deprecated - public String id; - @Deprecated - public String type; - @Deprecated - public net.consensys.eventeum.ContractEventDetails details; - @Deprecated - public net.consensys.eventeum.BlockDetails detailsBlock; - @Deprecated - public int retries; - - /** - * Default constructor. Note that this does not initialize fields - * to their default values from the schema. If that is desired then - * one should use newBuilder(). - */ - public EventBlock() { - } - - /** - * All-args constructor. - * @param id The new value for id - * @param type The new value for type - * @param details The new value for details - * @param detailsBlock The new value for detailsBlock - * @param retries The new value for retries - */ - public EventBlock(String id, String type, net.consensys.eventeum.ContractEventDetails details, net.consensys.eventeum.BlockDetails detailsBlock, Integer retries) { - this.id = id; - this.type = type; - this.details = details; - this.detailsBlock = detailsBlock; - this.retries = retries; - } - - public SpecificData getSpecificData() { - return MODEL$; - } - - public org.apache.avro.Schema getSchema() { - return SCHEMA$; - } - - // Used by DatumWriter. Applications should not call. - public Object get(int field$) { - switch (field$) { - case 0: - return id; - case 1: - return type; - case 2: - return details; - case 3: - return detailsBlock; - case 4: - return retries; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - // Used by DatumReader. Applications should not call. - @SuppressWarnings(value = "unchecked") - public void put(int field$, Object value$) { - switch (field$) { - case 0: - id = (String) value$; - break; - case 1: - type = (String) value$; - break; - case 2: - details = (net.consensys.eventeum.ContractEventDetails) value$; - break; - case 3: - detailsBlock = (net.consensys.eventeum.BlockDetails) value$; - break; - case 4: - retries = (Integer) value$; - break; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - /** - * Gets the value of the 'id' field. - * @return The value of the 'id' field. - */ - public String getId() { - return id; - } - - - /** - * Sets the value of the 'id' field. - * @param value the value to set. - */ - public void setId(String value) { - this.id = value; - } - - /** - * Gets the value of the 'type' field. - * @return The value of the 'type' field. - */ - public String getType() { - return type; - } - - - /** - * Sets the value of the 'type' field. - * @param value the value to set. - */ - public void setType(String value) { - this.type = value; - } - - /** - * Gets the value of the 'details' field. - * @return The value of the 'details' field. - */ - public net.consensys.eventeum.ContractEventDetails getDetails() { - return details; - } - - - /** - * Sets the value of the 'details' field. - * @param value the value to set. - */ - public void setDetails(net.consensys.eventeum.ContractEventDetails value) { - this.details = value; - } - - /** - * Gets the value of the 'detailsBlock' field. - * @return The value of the 'detailsBlock' field. - */ - public net.consensys.eventeum.BlockDetails getDetailsBlock() { - return detailsBlock; - } - - - /** - * Sets the value of the 'detailsBlock' field. - * @param value the value to set. - */ - public void setDetailsBlock(net.consensys.eventeum.BlockDetails value) { - this.detailsBlock = value; - } - - /** - * Gets the value of the 'retries' field. - * @return The value of the 'retries' field. - */ - public int getRetries() { - return retries; - } - - - /** - * Sets the value of the 'retries' field. - * @param value the value to set. - */ - public void setRetries(int value) { - this.retries = value; - } - - /** - * Creates a new EventBlock RecordBuilder. - * @return A new EventBlock RecordBuilder - */ - public static net.consensys.eventeum.EventBlock.Builder newBuilder() { - return new net.consensys.eventeum.EventBlock.Builder(); - } - - /** - * Creates a new EventBlock RecordBuilder by copying an existing Builder. - * @param other The existing builder to copy. - * @return A new EventBlock RecordBuilder - */ - public static net.consensys.eventeum.EventBlock.Builder newBuilder(net.consensys.eventeum.EventBlock.Builder other) { - if (other == null) { - return new net.consensys.eventeum.EventBlock.Builder(); - } else { - return new net.consensys.eventeum.EventBlock.Builder(other); - } - } - - /** - * Creates a new EventBlock RecordBuilder by copying an existing EventBlock instance. - * @param other The existing instance to copy. - * @return A new EventBlock RecordBuilder - */ - public static net.consensys.eventeum.EventBlock.Builder newBuilder(net.consensys.eventeum.EventBlock other) { - if (other == null) { - return new net.consensys.eventeum.EventBlock.Builder(); - } else { - return new net.consensys.eventeum.EventBlock.Builder(other); - } - } - - /** - * RecordBuilder for EventBlock instances. - */ - public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase - implements org.apache.avro.data.RecordBuilder { - - private String id; - private String type; - private net.consensys.eventeum.ContractEventDetails details; - private net.consensys.eventeum.ContractEventDetails.Builder detailsBuilder; - private net.consensys.eventeum.BlockDetails detailsBlock; - private net.consensys.eventeum.BlockDetails.Builder detailsBlockBuilder; - private int retries; - - /** Creates a new Builder */ - private Builder() { - super(SCHEMA$); - } - - /** - * Creates a Builder by copying an existing Builder. - * @param other The existing Builder to copy. - */ - private Builder(net.consensys.eventeum.EventBlock.Builder other) { - super(other); - if (isValidValue(fields()[0], other.id)) { - this.id = data().deepCopy(fields()[0].schema(), other.id); - fieldSetFlags()[0] = other.fieldSetFlags()[0]; - } - if (isValidValue(fields()[1], other.type)) { - this.type = data().deepCopy(fields()[1].schema(), other.type); - fieldSetFlags()[1] = other.fieldSetFlags()[1]; - } - if (isValidValue(fields()[2], other.details)) { - this.details = data().deepCopy(fields()[2].schema(), other.details); - fieldSetFlags()[2] = other.fieldSetFlags()[2]; - } - if (other.hasDetailsBuilder()) { - this.detailsBuilder = net.consensys.eventeum.ContractEventDetails.newBuilder(other.getDetailsBuilder()); - } - if (isValidValue(fields()[3], other.detailsBlock)) { - this.detailsBlock = data().deepCopy(fields()[3].schema(), other.detailsBlock); - fieldSetFlags()[3] = other.fieldSetFlags()[3]; - } - if (other.hasDetailsBlockBuilder()) { - this.detailsBlockBuilder = net.consensys.eventeum.BlockDetails.newBuilder(other.getDetailsBlockBuilder()); - } - if (isValidValue(fields()[4], other.retries)) { - this.retries = data().deepCopy(fields()[4].schema(), other.retries); - fieldSetFlags()[4] = other.fieldSetFlags()[4]; - } - } - - /** - * Creates a Builder by copying an existing EventBlock instance - * @param other The existing instance to copy. - */ - private Builder(net.consensys.eventeum.EventBlock other) { - super(SCHEMA$); - if (isValidValue(fields()[0], other.id)) { - this.id = data().deepCopy(fields()[0].schema(), other.id); - fieldSetFlags()[0] = true; - } - if (isValidValue(fields()[1], other.type)) { - this.type = data().deepCopy(fields()[1].schema(), other.type); - fieldSetFlags()[1] = true; - } - if (isValidValue(fields()[2], other.details)) { - this.details = data().deepCopy(fields()[2].schema(), other.details); - fieldSetFlags()[2] = true; - } - this.detailsBuilder = null; - if (isValidValue(fields()[3], other.detailsBlock)) { - this.detailsBlock = data().deepCopy(fields()[3].schema(), other.detailsBlock); - fieldSetFlags()[3] = true; - } - this.detailsBlockBuilder = null; - if (isValidValue(fields()[4], other.retries)) { - this.retries = data().deepCopy(fields()[4].schema(), other.retries); - fieldSetFlags()[4] = true; - } - } - - /** - * Gets the value of the 'id' field. - * @return The value. - */ - public String getId() { - return id; - } - - - /** - * Sets the value of the 'id' field. - * @param value The value of 'id'. - * @return This builder. - */ - public net.consensys.eventeum.EventBlock.Builder setId(String value) { - validate(fields()[0], value); - this.id = value; - fieldSetFlags()[0] = true; - return this; - } - - /** - * Checks whether the 'id' field has been set. - * @return True if the 'id' field has been set, false otherwise. - */ - public boolean hasId() { - return fieldSetFlags()[0]; - } - - - /** - * Clears the value of the 'id' field. - * @return This builder. - */ - public net.consensys.eventeum.EventBlock.Builder clearId() { - id = null; - fieldSetFlags()[0] = false; - return this; - } - - /** - * Gets the value of the 'type' field. - * @return The value. - */ - public String getType() { - return type; - } - - - /** - * Sets the value of the 'type' field. - * @param value The value of 'type'. - * @return This builder. - */ - public net.consensys.eventeum.EventBlock.Builder setType(String value) { - validate(fields()[1], value); - this.type = value; - fieldSetFlags()[1] = true; - return this; - } - - /** - * Checks whether the 'type' field has been set. - * @return True if the 'type' field has been set, false otherwise. - */ - public boolean hasType() { - return fieldSetFlags()[1]; - } - - - /** - * Clears the value of the 'type' field. - * @return This builder. - */ - public net.consensys.eventeum.EventBlock.Builder clearType() { - type = null; - fieldSetFlags()[1] = false; - return this; - } - - /** - * Gets the value of the 'details' field. - * @return The value. - */ - public net.consensys.eventeum.ContractEventDetails getDetails() { - return details; - } - - - /** - * Sets the value of the 'details' field. - * @param value The value of 'details'. - * @return This builder. - */ - public net.consensys.eventeum.EventBlock.Builder setDetails(net.consensys.eventeum.ContractEventDetails value) { - validate(fields()[2], value); - this.detailsBuilder = null; - this.details = value; - fieldSetFlags()[2] = true; - return this; - } - - /** - * Checks whether the 'details' field has been set. - * @return True if the 'details' field has been set, false otherwise. - */ - public boolean hasDetails() { - return fieldSetFlags()[2]; - } - - /** - * Gets the Builder instance for the 'details' field and creates one if it doesn't exist yet. - * @return This builder. - */ - public net.consensys.eventeum.ContractEventDetails.Builder getDetailsBuilder() { - if (detailsBuilder == null) { - if (hasDetails()) { - setDetailsBuilder(net.consensys.eventeum.ContractEventDetails.newBuilder(details)); - } else { - setDetailsBuilder(net.consensys.eventeum.ContractEventDetails.newBuilder()); - } - } - return detailsBuilder; - } - - /** - * Sets the Builder instance for the 'details' field - * @param value The builder instance that must be set. - * @return This builder. - */ - public net.consensys.eventeum.EventBlock.Builder setDetailsBuilder(net.consensys.eventeum.ContractEventDetails.Builder value) { - clearDetails(); - detailsBuilder = value; - return this; - } - - /** - * Checks whether the 'details' field has an active Builder instance - * @return True if the 'details' field has an active Builder instance - */ - public boolean hasDetailsBuilder() { - return detailsBuilder != null; - } - - /** - * Clears the value of the 'details' field. - * @return This builder. - */ - public net.consensys.eventeum.EventBlock.Builder clearDetails() { - details = null; - detailsBuilder = null; - fieldSetFlags()[2] = false; - return this; - } - - /** - * Gets the value of the 'detailsBlock' field. - * @return The value. - */ - public net.consensys.eventeum.BlockDetails getDetailsBlock() { - return detailsBlock; - } - - - /** - * Sets the value of the 'detailsBlock' field. - * @param value The value of 'detailsBlock'. - * @return This builder. - */ - public net.consensys.eventeum.EventBlock.Builder setDetailsBlock(net.consensys.eventeum.BlockDetails value) { - validate(fields()[3], value); - this.detailsBlockBuilder = null; - this.detailsBlock = value; - fieldSetFlags()[3] = true; - return this; - } - - /** - * Checks whether the 'detailsBlock' field has been set. - * @return True if the 'detailsBlock' field has been set, false otherwise. - */ - public boolean hasDetailsBlock() { - return fieldSetFlags()[3]; - } - - /** - * Gets the Builder instance for the 'detailsBlock' field and creates one if it doesn't exist yet. - * @return This builder. - */ - public net.consensys.eventeum.BlockDetails.Builder getDetailsBlockBuilder() { - if (detailsBlockBuilder == null) { - if (hasDetailsBlock()) { - setDetailsBlockBuilder(net.consensys.eventeum.BlockDetails.newBuilder(detailsBlock)); - } else { - setDetailsBlockBuilder(net.consensys.eventeum.BlockDetails.newBuilder()); - } - } - return detailsBlockBuilder; - } - - /** - * Sets the Builder instance for the 'detailsBlock' field - * @param value The builder instance that must be set. - * @return This builder. - */ - public net.consensys.eventeum.EventBlock.Builder setDetailsBlockBuilder(net.consensys.eventeum.BlockDetails.Builder value) { - clearDetailsBlock(); - detailsBlockBuilder = value; - return this; - } - - /** - * Checks whether the 'detailsBlock' field has an active Builder instance - * @return True if the 'detailsBlock' field has an active Builder instance - */ - public boolean hasDetailsBlockBuilder() { - return detailsBlockBuilder != null; - } - - /** - * Clears the value of the 'detailsBlock' field. - * @return This builder. - */ - public net.consensys.eventeum.EventBlock.Builder clearDetailsBlock() { - detailsBlock = null; - detailsBlockBuilder = null; - fieldSetFlags()[3] = false; - return this; - } - - /** - * Gets the value of the 'retries' field. - * @return The value. - */ - public int getRetries() { - return retries; - } - - - /** - * Sets the value of the 'retries' field. - * @param value The value of 'retries'. - * @return This builder. - */ - public net.consensys.eventeum.EventBlock.Builder setRetries(int value) { - validate(fields()[4], value); - this.retries = value; - fieldSetFlags()[4] = true; - return this; - } - - /** - * Checks whether the 'retries' field has been set. - * @return True if the 'retries' field has been set, false otherwise. - */ - public boolean hasRetries() { - return fieldSetFlags()[4]; - } - - - /** - * Clears the value of the 'retries' field. - * @return This builder. - */ - public net.consensys.eventeum.EventBlock.Builder clearRetries() { - fieldSetFlags()[4] = false; - return this; - } - - @Override - @SuppressWarnings("unchecked") - public EventBlock build() { - try { - EventBlock record = new EventBlock(); - record.id = fieldSetFlags()[0] ? this.id : (String) defaultValue(fields()[0]); - record.type = fieldSetFlags()[1] ? this.type : (String) defaultValue(fields()[1]); - if (detailsBuilder != null) { - try { - record.details = this.detailsBuilder.build(); - } catch (org.apache.avro.AvroMissingFieldException e) { - e.addParentField(record.getSchema().getField("details")); - throw e; - } - } else { - record.details = fieldSetFlags()[2] ? this.details : (net.consensys.eventeum.ContractEventDetails) defaultValue(fields()[2]); - } - if (detailsBlockBuilder != null) { - try { - record.detailsBlock = this.detailsBlockBuilder.build(); - } catch (org.apache.avro.AvroMissingFieldException e) { - e.addParentField(record.getSchema().getField("detailsBlock")); - throw e; - } - } else { - record.detailsBlock = fieldSetFlags()[3] ? this.detailsBlock : (net.consensys.eventeum.BlockDetails) defaultValue(fields()[3]); - } - record.retries = fieldSetFlags()[4] ? this.retries : (Integer) defaultValue(fields()[4]); - return record; - } catch (org.apache.avro.AvroMissingFieldException e) { - throw e; - } catch (Exception e) { - throw new org.apache.avro.AvroRuntimeException(e); - } - } - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter) MODEL$.createDatumWriter(SCHEMA$); - - @Override - public void writeExternal(java.io.ObjectOutput out) - throws java.io.IOException { - WRITER$.write(this, SpecificData.getEncoder(out)); - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader) MODEL$.createDatumReader(SCHEMA$); - - @Override - public void readExternal(java.io.ObjectInput in) - throws java.io.IOException { - READER$.read(this, SpecificData.getDecoder(in)); - } - -} - - - - - - - - - - diff --git a/src/main/java/net/consensys/eventeum/NumberParameter.java b/src/main/java/net/consensys/eventeum/NumberParameter.java deleted file mode 100644 index 855f4ea..0000000 --- a/src/main/java/net/consensys/eventeum/NumberParameter.java +++ /dev/null @@ -1,497 +0,0 @@ -/** - * Autogenerated by Avro - *

- * DO NOT EDIT DIRECTLY - */ -package net.consensys.eventeum; - -import org.apache.avro.message.BinaryMessageDecoder; -import org.apache.avro.message.BinaryMessageEncoder; -import org.apache.avro.message.SchemaStore; -import org.apache.avro.specific.SpecificData; - -@org.apache.avro.specific.AvroGenerated -public class NumberParameter extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = -5788241449146873692L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"NumberParameter\",\"namespace\":\"net.consensys.eventeum\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"java-class\":\"java.math.BigInteger\"}]}"); - - public static org.apache.avro.Schema getClassSchema() { - return SCHEMA$; - } - - private static SpecificData MODEL$ = new SpecificData(); - - private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); - - private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); - - /** - * Return the BinaryMessageEncoder instance used by this class. - * @return the message encoder used by this class - */ - public static BinaryMessageEncoder getEncoder() { - return ENCODER; - } - - /** - * Return the BinaryMessageDecoder instance used by this class. - * @return the message decoder used by this class - */ - public static BinaryMessageDecoder getDecoder() { - return DECODER; - } - - /** - * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}. - * @param resolver a {@link SchemaStore} used to find schemas by fingerprint - * @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore - */ - public static BinaryMessageDecoder createDecoder(SchemaStore resolver) { - return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver); - } - - /** - * Serializes this NumberParameter to a ByteBuffer. - * @return a buffer holding the serialized data for this instance - * @throws java.io.IOException if this instance could not be serialized - */ - public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { - return ENCODER.encode(this); - } - - /** - * Deserializes a NumberParameter from a ByteBuffer. - * @param b a byte buffer holding serialized data for an instance of this class - * @return a NumberParameter instance decoded from the given buffer - * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class - */ - public static NumberParameter fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { - return DECODER.decode(b); - } - - @Deprecated - public String name; - @Deprecated - public String type; - @Deprecated - public String value; - - /** - * Default constructor. Note that this does not initialize fields - * to their default values from the schema. If that is desired then - * one should use newBuilder(). - */ - public NumberParameter() { - } - - /** - * All-args constructor. - * @param name The new value for name - * @param type The new value for type - * @param value The new value for value - */ - public NumberParameter(String name, String type, String value) { - this.name = name; - this.type = type; - this.value = value; - } - - public org.apache.avro.specific.SpecificData getSpecificData() { - return MODEL$; - } - - public org.apache.avro.Schema getSchema() { - return SCHEMA$; - } - - // Used by DatumWriter. Applications should not call. - public Object get(int field$) { - switch (field$) { - case 0: - return name; - case 1: - return type; - case 2: - return value; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - // Used by DatumReader. Applications should not call. - @SuppressWarnings(value = "unchecked") - public void put(int field$, Object value$) { - switch (field$) { - case 0: - name = (String) value$; - break; - case 1: - type = (String) value$; - break; - case 2: - value = (String) value$; - break; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - /** - * Gets the value of the 'name' field. - * @return The value of the 'name' field. - */ - public String getName() { - return name; - } - - - /** - * Sets the value of the 'name' field. - * @param value the value to set. - */ - public void setName(String value) { - this.name = value; - } - - /** - * Gets the value of the 'type' field. - * @return The value of the 'type' field. - */ - public String getType() { - return type; - } - - - /** - * Sets the value of the 'type' field. - * @param value the value to set. - */ - public void setType(String value) { - this.type = value; - } - - /** - * Gets the value of the 'value' field. - * @return The value of the 'value' field. - */ - public String getValue() { - return value; - } - - - /** - * Sets the value of the 'value' field. - * @param value the value to set. - */ - public void setValue(String value) { - this.value = value; - } - - /** - * Creates a new NumberParameter RecordBuilder. - * @return A new NumberParameter RecordBuilder - */ - public static net.consensys.eventeum.NumberParameter.Builder newBuilder() { - return new net.consensys.eventeum.NumberParameter.Builder(); - } - - /** - * Creates a new NumberParameter RecordBuilder by copying an existing Builder. - * @param other The existing builder to copy. - * @return A new NumberParameter RecordBuilder - */ - public static net.consensys.eventeum.NumberParameter.Builder newBuilder(net.consensys.eventeum.NumberParameter.Builder other) { - if (other == null) { - return new net.consensys.eventeum.NumberParameter.Builder(); - } else { - return new net.consensys.eventeum.NumberParameter.Builder(other); - } - } - - /** - * Creates a new NumberParameter RecordBuilder by copying an existing NumberParameter instance. - * @param other The existing instance to copy. - * @return A new NumberParameter RecordBuilder - */ - public static net.consensys.eventeum.NumberParameter.Builder newBuilder(net.consensys.eventeum.NumberParameter other) { - if (other == null) { - return new net.consensys.eventeum.NumberParameter.Builder(); - } else { - return new net.consensys.eventeum.NumberParameter.Builder(other); - } - } - - /** - * RecordBuilder for NumberParameter instances. - */ - public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase - implements org.apache.avro.data.RecordBuilder { - - private String name; - private String type; - private String value; - - /** Creates a new Builder */ - private Builder() { - super(SCHEMA$); - } - - /** - * Creates a Builder by copying an existing Builder. - * @param other The existing Builder to copy. - */ - private Builder(net.consensys.eventeum.NumberParameter.Builder other) { - super(other); - if (isValidValue(fields()[0], other.name)) { - this.name = data().deepCopy(fields()[0].schema(), other.name); - fieldSetFlags()[0] = other.fieldSetFlags()[0]; - } - if (isValidValue(fields()[1], other.type)) { - this.type = data().deepCopy(fields()[1].schema(), other.type); - fieldSetFlags()[1] = other.fieldSetFlags()[1]; - } - if (isValidValue(fields()[2], other.value)) { - this.value = data().deepCopy(fields()[2].schema(), other.value); - fieldSetFlags()[2] = other.fieldSetFlags()[2]; - } - } - - /** - * Creates a Builder by copying an existing NumberParameter instance - * @param other The existing instance to copy. - */ - private Builder(net.consensys.eventeum.NumberParameter other) { - super(SCHEMA$); - if (isValidValue(fields()[0], other.name)) { - this.name = data().deepCopy(fields()[0].schema(), other.name); - fieldSetFlags()[0] = true; - } - if (isValidValue(fields()[1], other.type)) { - this.type = data().deepCopy(fields()[1].schema(), other.type); - fieldSetFlags()[1] = true; - } - if (isValidValue(fields()[2], other.value)) { - this.value = data().deepCopy(fields()[2].schema(), other.value); - fieldSetFlags()[2] = true; - } - } - - /** - * Gets the value of the 'name' field. - * @return The value. - */ - public String getName() { - return name; - } - - - /** - * Sets the value of the 'name' field. - * @param value The value of 'name'. - * @return This builder. - */ - public net.consensys.eventeum.NumberParameter.Builder setName(String value) { - validate(fields()[0], value); - this.name = value; - fieldSetFlags()[0] = true; - return this; - } - - /** - * Checks whether the 'name' field has been set. - * @return True if the 'name' field has been set, false otherwise. - */ - public boolean hasName() { - return fieldSetFlags()[0]; - } - - - /** - * Clears the value of the 'name' field. - * @return This builder. - */ - public net.consensys.eventeum.NumberParameter.Builder clearName() { - name = null; - fieldSetFlags()[0] = false; - return this; - } - - /** - * Gets the value of the 'type' field. - * @return The value. - */ - public String getType() { - return type; - } - - - /** - * Sets the value of the 'type' field. - * @param value The value of 'type'. - * @return This builder. - */ - public net.consensys.eventeum.NumberParameter.Builder setType(String value) { - validate(fields()[1], value); - this.type = value; - fieldSetFlags()[1] = true; - return this; - } - - /** - * Checks whether the 'type' field has been set. - * @return True if the 'type' field has been set, false otherwise. - */ - public boolean hasType() { - return fieldSetFlags()[1]; - } - - - /** - * Clears the value of the 'type' field. - * @return This builder. - */ - public net.consensys.eventeum.NumberParameter.Builder clearType() { - type = null; - fieldSetFlags()[1] = false; - return this; - } - - /** - * Gets the value of the 'value' field. - * @return The value. - */ - public String getValue() { - return value; - } - - - /** - * Sets the value of the 'value' field. - * @param value The value of 'value'. - * @return This builder. - */ - public net.consensys.eventeum.NumberParameter.Builder setValue(String value) { - validate(fields()[2], value); - this.value = value; - fieldSetFlags()[2] = true; - return this; - } - - /** - * Checks whether the 'value' field has been set. - * @return True if the 'value' field has been set, false otherwise. - */ - public boolean hasValue() { - return fieldSetFlags()[2]; - } - - - /** - * Clears the value of the 'value' field. - * @return This builder. - */ - public net.consensys.eventeum.NumberParameter.Builder clearValue() { - value = null; - fieldSetFlags()[2] = false; - return this; - } - - @Override - @SuppressWarnings("unchecked") - public NumberParameter build() { - try { - NumberParameter record = new NumberParameter(); - record.name = fieldSetFlags()[0] ? this.name : (String) defaultValue(fields()[0]); - record.type = fieldSetFlags()[1] ? this.type : (String) defaultValue(fields()[1]); - record.value = fieldSetFlags()[2] ? this.value : (String) defaultValue(fields()[2]); - return record; - } catch (org.apache.avro.AvroMissingFieldException e) { - throw e; - } catch (Exception e) { - throw new org.apache.avro.AvroRuntimeException(e); - } - } - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter) MODEL$.createDatumWriter(SCHEMA$); - - @Override - public void writeExternal(java.io.ObjectOutput out) - throws java.io.IOException { - WRITER$.write(this, SpecificData.getEncoder(out)); - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader) MODEL$.createDatumReader(SCHEMA$); - - @Override - public void readExternal(java.io.ObjectInput in) - throws java.io.IOException { - READER$.read(this, SpecificData.getDecoder(in)); - } - - @Override - protected boolean hasCustomCoders() { - return true; - } - - @Override - public void customEncode(org.apache.avro.io.Encoder out) - throws java.io.IOException { - out.writeString(this.name); - - out.writeString(this.type); - - out.writeString(this.value); - - } - - @Override - public void customDecode(org.apache.avro.io.ResolvingDecoder in) - throws java.io.IOException { - org.apache.avro.Schema.Field[] fieldOrder = in.readFieldOrderIfDiff(); - if (fieldOrder == null) { - this.name = in.readString(); - - this.type = in.readString(); - - this.value = in.readString(); - - } else { - for (int i = 0; i < 3; i++) { - switch (fieldOrder[i].pos()) { - case 0: - this.name = in.readString(); - break; - - case 1: - this.type = in.readString(); - break; - - case 2: - this.value = in.readString(); - break; - - default: - throw new java.io.IOException("Corrupt ResolvingDecoder."); - } - } - } - } -} - - - - - - - - - - diff --git a/src/main/java/net/consensys/eventeum/StringParameter.java b/src/main/java/net/consensys/eventeum/StringParameter.java deleted file mode 100644 index 728882d..0000000 --- a/src/main/java/net/consensys/eventeum/StringParameter.java +++ /dev/null @@ -1,497 +0,0 @@ -/** - * Autogenerated by Avro - *

- * DO NOT EDIT DIRECTLY - */ -package net.consensys.eventeum; - -import org.apache.avro.message.BinaryMessageDecoder; -import org.apache.avro.message.BinaryMessageEncoder; -import org.apache.avro.message.SchemaStore; -import org.apache.avro.specific.SpecificData; - -@org.apache.avro.specific.AvroGenerated -public class StringParameter extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = -7626022158636516734L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"StringParameter\",\"namespace\":\"net.consensys.eventeum\",\"fields\":[{\"name\":\"name\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}}]}"); - - public static org.apache.avro.Schema getClassSchema() { - return SCHEMA$; - } - - private static SpecificData MODEL$ = new SpecificData(); - - private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); - - private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); - - /** - * Return the BinaryMessageEncoder instance used by this class. - * @return the message encoder used by this class - */ - public static BinaryMessageEncoder getEncoder() { - return ENCODER; - } - - /** - * Return the BinaryMessageDecoder instance used by this class. - * @return the message decoder used by this class - */ - public static BinaryMessageDecoder getDecoder() { - return DECODER; - } - - /** - * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}. - * @param resolver a {@link SchemaStore} used to find schemas by fingerprint - * @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore - */ - public static BinaryMessageDecoder createDecoder(SchemaStore resolver) { - return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver); - } - - /** - * Serializes this StringParameter to a ByteBuffer. - * @return a buffer holding the serialized data for this instance - * @throws java.io.IOException if this instance could not be serialized - */ - public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { - return ENCODER.encode(this); - } - - /** - * Deserializes a StringParameter from a ByteBuffer. - * @param b a byte buffer holding serialized data for an instance of this class - * @return a StringParameter instance decoded from the given buffer - * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class - */ - public static StringParameter fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { - return DECODER.decode(b); - } - - @Deprecated - public String name; - @Deprecated - public String type; - @Deprecated - public String value; - - /** - * Default constructor. Note that this does not initialize fields - * to their default values from the schema. If that is desired then - * one should use newBuilder(). - */ - public StringParameter() { - } - - /** - * All-args constructor. - * @param name The new value for name - * @param type The new value for type - * @param value The new value for value - */ - public StringParameter(String name, String type, String value) { - this.name = name; - this.type = type; - this.value = value; - } - - public org.apache.avro.specific.SpecificData getSpecificData() { - return MODEL$; - } - - public org.apache.avro.Schema getSchema() { - return SCHEMA$; - } - - // Used by DatumWriter. Applications should not call. - public Object get(int field$) { - switch (field$) { - case 0: - return name; - case 1: - return type; - case 2: - return value; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - // Used by DatumReader. Applications should not call. - @SuppressWarnings(value = "unchecked") - public void put(int field$, Object value$) { - switch (field$) { - case 0: - name = (String) value$; - break; - case 1: - type = (String) value$; - break; - case 2: - value = (String) value$; - break; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - /** - * Gets the value of the 'name' field. - * @return The value of the 'name' field. - */ - public String getName() { - return name; - } - - - /** - * Sets the value of the 'name' field. - * @param value the value to set. - */ - public void setName(String value) { - this.name = value; - } - - /** - * Gets the value of the 'type' field. - * @return The value of the 'type' field. - */ - public String getType() { - return type; - } - - - /** - * Sets the value of the 'type' field. - * @param value the value to set. - */ - public void setType(String value) { - this.type = value; - } - - /** - * Gets the value of the 'value' field. - * @return The value of the 'value' field. - */ - public String getValue() { - return value; - } - - - /** - * Sets the value of the 'value' field. - * @param value the value to set. - */ - public void setValue(String value) { - this.value = value; - } - - /** - * Creates a new StringParameter RecordBuilder. - * @return A new StringParameter RecordBuilder - */ - public static net.consensys.eventeum.StringParameter.Builder newBuilder() { - return new net.consensys.eventeum.StringParameter.Builder(); - } - - /** - * Creates a new StringParameter RecordBuilder by copying an existing Builder. - * @param other The existing builder to copy. - * @return A new StringParameter RecordBuilder - */ - public static net.consensys.eventeum.StringParameter.Builder newBuilder(net.consensys.eventeum.StringParameter.Builder other) { - if (other == null) { - return new net.consensys.eventeum.StringParameter.Builder(); - } else { - return new net.consensys.eventeum.StringParameter.Builder(other); - } - } - - /** - * Creates a new StringParameter RecordBuilder by copying an existing StringParameter instance. - * @param other The existing instance to copy. - * @return A new StringParameter RecordBuilder - */ - public static net.consensys.eventeum.StringParameter.Builder newBuilder(net.consensys.eventeum.StringParameter other) { - if (other == null) { - return new net.consensys.eventeum.StringParameter.Builder(); - } else { - return new net.consensys.eventeum.StringParameter.Builder(other); - } - } - - /** - * RecordBuilder for StringParameter instances. - */ - public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase - implements org.apache.avro.data.RecordBuilder { - - private String name; - private String type; - private String value; - - /** Creates a new Builder */ - private Builder() { - super(SCHEMA$); - } - - /** - * Creates a Builder by copying an existing Builder. - * @param other The existing Builder to copy. - */ - private Builder(net.consensys.eventeum.StringParameter.Builder other) { - super(other); - if (isValidValue(fields()[0], other.name)) { - this.name = data().deepCopy(fields()[0].schema(), other.name); - fieldSetFlags()[0] = other.fieldSetFlags()[0]; - } - if (isValidValue(fields()[1], other.type)) { - this.type = data().deepCopy(fields()[1].schema(), other.type); - fieldSetFlags()[1] = other.fieldSetFlags()[1]; - } - if (isValidValue(fields()[2], other.value)) { - this.value = data().deepCopy(fields()[2].schema(), other.value); - fieldSetFlags()[2] = other.fieldSetFlags()[2]; - } - } - - /** - * Creates a Builder by copying an existing StringParameter instance - * @param other The existing instance to copy. - */ - private Builder(net.consensys.eventeum.StringParameter other) { - super(SCHEMA$); - if (isValidValue(fields()[0], other.name)) { - this.name = data().deepCopy(fields()[0].schema(), other.name); - fieldSetFlags()[0] = true; - } - if (isValidValue(fields()[1], other.type)) { - this.type = data().deepCopy(fields()[1].schema(), other.type); - fieldSetFlags()[1] = true; - } - if (isValidValue(fields()[2], other.value)) { - this.value = data().deepCopy(fields()[2].schema(), other.value); - fieldSetFlags()[2] = true; - } - } - - /** - * Gets the value of the 'name' field. - * @return The value. - */ - public String getName() { - return name; - } - - - /** - * Sets the value of the 'name' field. - * @param value The value of 'name'. - * @return This builder. - */ - public net.consensys.eventeum.StringParameter.Builder setName(String value) { - validate(fields()[0], value); - this.name = value; - fieldSetFlags()[0] = true; - return this; - } - - /** - * Checks whether the 'name' field has been set. - * @return True if the 'name' field has been set, false otherwise. - */ - public boolean hasName() { - return fieldSetFlags()[0]; - } - - - /** - * Clears the value of the 'name' field. - * @return This builder. - */ - public net.consensys.eventeum.StringParameter.Builder clearName() { - name = null; - fieldSetFlags()[0] = false; - return this; - } - - /** - * Gets the value of the 'type' field. - * @return The value. - */ - public String getType() { - return type; - } - - - /** - * Sets the value of the 'type' field. - * @param value The value of 'type'. - * @return This builder. - */ - public net.consensys.eventeum.StringParameter.Builder setType(String value) { - validate(fields()[1], value); - this.type = value; - fieldSetFlags()[1] = true; - return this; - } - - /** - * Checks whether the 'type' field has been set. - * @return True if the 'type' field has been set, false otherwise. - */ - public boolean hasType() { - return fieldSetFlags()[1]; - } - - - /** - * Clears the value of the 'type' field. - * @return This builder. - */ - public net.consensys.eventeum.StringParameter.Builder clearType() { - type = null; - fieldSetFlags()[1] = false; - return this; - } - - /** - * Gets the value of the 'value' field. - * @return The value. - */ - public String getValue() { - return value; - } - - - /** - * Sets the value of the 'value' field. - * @param value The value of 'value'. - * @return This builder. - */ - public net.consensys.eventeum.StringParameter.Builder setValue(String value) { - validate(fields()[2], value); - this.value = value; - fieldSetFlags()[2] = true; - return this; - } - - /** - * Checks whether the 'value' field has been set. - * @return True if the 'value' field has been set, false otherwise. - */ - public boolean hasValue() { - return fieldSetFlags()[2]; - } - - - /** - * Clears the value of the 'value' field. - * @return This builder. - */ - public net.consensys.eventeum.StringParameter.Builder clearValue() { - value = null; - fieldSetFlags()[2] = false; - return this; - } - - @Override - @SuppressWarnings("unchecked") - public StringParameter build() { - try { - StringParameter record = new StringParameter(); - record.name = fieldSetFlags()[0] ? this.name : (String) defaultValue(fields()[0]); - record.type = fieldSetFlags()[1] ? this.type : (String) defaultValue(fields()[1]); - record.value = fieldSetFlags()[2] ? this.value : (String) defaultValue(fields()[2]); - return record; - } catch (org.apache.avro.AvroMissingFieldException e) { - throw e; - } catch (Exception e) { - throw new org.apache.avro.AvroRuntimeException(e); - } - } - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter) MODEL$.createDatumWriter(SCHEMA$); - - @Override - public void writeExternal(java.io.ObjectOutput out) - throws java.io.IOException { - WRITER$.write(this, SpecificData.getEncoder(out)); - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader) MODEL$.createDatumReader(SCHEMA$); - - @Override - public void readExternal(java.io.ObjectInput in) - throws java.io.IOException { - READER$.read(this, SpecificData.getDecoder(in)); - } - - @Override - protected boolean hasCustomCoders() { - return true; - } - - @Override - public void customEncode(org.apache.avro.io.Encoder out) - throws java.io.IOException { - out.writeString(this.name); - - out.writeString(this.type); - - out.writeString(this.value); - - } - - @Override - public void customDecode(org.apache.avro.io.ResolvingDecoder in) - throws java.io.IOException { - org.apache.avro.Schema.Field[] fieldOrder = in.readFieldOrderIfDiff(); - if (fieldOrder == null) { - this.name = in.readString(); - - this.type = in.readString(); - - this.value = in.readString(); - - } else { - for (int i = 0; i < 3; i++) { - switch (fieldOrder[i].pos()) { - case 0: - this.name = in.readString(); - break; - - case 1: - this.type = in.readString(); - break; - - case 2: - this.value = in.readString(); - break; - - default: - throw new java.io.IOException("Corrupt ResolvingDecoder."); - } - } - } - } -} - - - - - - - - - - diff --git a/src/main/java/net/consensys/eventeum/TransactionDetails.java b/src/main/java/net/consensys/eventeum/TransactionDetails.java deleted file mode 100644 index 076ce01..0000000 --- a/src/main/java/net/consensys/eventeum/TransactionDetails.java +++ /dev/null @@ -1,1337 +0,0 @@ -/** - * Autogenerated by Avro - *

- * DO NOT EDIT DIRECTLY - */ -package net.consensys.eventeum; - -import org.apache.avro.message.BinaryMessageDecoder; -import org.apache.avro.message.BinaryMessageEncoder; -import org.apache.avro.message.SchemaStore; -import org.apache.avro.specific.SpecificData; - -@org.apache.avro.specific.AvroGenerated -public class TransactionDetails extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = -3487675989958263773L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"TransactionDetails\",\"namespace\":\"net.consensys.eventeum\",\"fields\":[{\"name\":\"hash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nonce\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"blockNumber\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"blockHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"transactionIndex\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"from\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"to\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"contractAddress\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"input\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"revertReason\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"status\",\"type\":{\"type\":\"enum\",\"name\":\"TransactionStatus\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\",\"FAILED\"]}}]}"); - - public static org.apache.avro.Schema getClassSchema() { - return SCHEMA$; - } - - private static SpecificData MODEL$ = new SpecificData(); - - private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); - - private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); - - /** - * Return the BinaryMessageEncoder instance used by this class. - * @return the message encoder used by this class - */ - public static BinaryMessageEncoder getEncoder() { - return ENCODER; - } - - /** - * Return the BinaryMessageDecoder instance used by this class. - * @return the message decoder used by this class - */ - public static BinaryMessageDecoder getDecoder() { - return DECODER; - } - - /** - * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}. - * @param resolver a {@link SchemaStore} used to find schemas by fingerprint - * @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore - */ - public static BinaryMessageDecoder createDecoder(SchemaStore resolver) { - return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver); - } - - /** - * Serializes this TransactionDetails to a ByteBuffer. - * @return a buffer holding the serialized data for this instance - * @throws java.io.IOException if this instance could not be serialized - */ - public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { - return ENCODER.encode(this); - } - - /** - * Deserializes a TransactionDetails from a ByteBuffer. - * @param b a byte buffer holding serialized data for an instance of this class - * @return a TransactionDetails instance decoded from the given buffer - * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class - */ - public static TransactionDetails fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { - return DECODER.decode(b); - } - - @Deprecated - public String hash; - @Deprecated - public String nonce; - @Deprecated - public String blockNumber; - @Deprecated - public String blockHash; - @Deprecated - public String transactionIndex; - @Deprecated - public String from; - @Deprecated - public String to; - @Deprecated - public String value; - @Deprecated - public String nodeName; - @Deprecated - public String contractAddress; - @Deprecated - public String input; - @Deprecated - public String revertReason; - @Deprecated - public net.consensys.eventeum.TransactionStatus status; - - /** - * Default constructor. Note that this does not initialize fields - * to their default values from the schema. If that is desired then - * one should use newBuilder(). - */ - public TransactionDetails() { - } - - /** - * All-args constructor. - * @param hash The new value for hash - * @param nonce The new value for nonce - * @param blockNumber The new value for blockNumber - * @param blockHash The new value for blockHash - * @param transactionIndex The new value for transactionIndex - * @param from The new value for from - * @param to The new value for to - * @param value The new value for value - * @param nodeName The new value for nodeName - * @param contractAddress The new value for contractAddress - * @param input The new value for input - * @param revertReason The new value for revertReason - * @param status The new value for status - */ - public TransactionDetails(String hash, String nonce, String blockNumber, String blockHash, String transactionIndex, String from, String to, String value, String nodeName, String contractAddress, String input, String revertReason, net.consensys.eventeum.TransactionStatus status) { - this.hash = hash; - this.nonce = nonce; - this.blockNumber = blockNumber; - this.blockHash = blockHash; - this.transactionIndex = transactionIndex; - this.from = from; - this.to = to; - this.value = value; - this.nodeName = nodeName; - this.contractAddress = contractAddress; - this.input = input; - this.revertReason = revertReason; - this.status = status; - } - - public org.apache.avro.specific.SpecificData getSpecificData() { - return MODEL$; - } - - public org.apache.avro.Schema getSchema() { - return SCHEMA$; - } - - // Used by DatumWriter. Applications should not call. - public Object get(int field$) { - switch (field$) { - case 0: - return hash; - case 1: - return nonce; - case 2: - return blockNumber; - case 3: - return blockHash; - case 4: - return transactionIndex; - case 5: - return from; - case 6: - return to; - case 7: - return value; - case 8: - return nodeName; - case 9: - return contractAddress; - case 10: - return input; - case 11: - return revertReason; - case 12: - return status; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - // Used by DatumReader. Applications should not call. - @SuppressWarnings(value = "unchecked") - public void put(int field$, Object value$) { - switch (field$) { - case 0: - hash = (String) value$; - break; - case 1: - nonce = (String) value$; - break; - case 2: - blockNumber = (String) value$; - break; - case 3: - blockHash = (String) value$; - break; - case 4: - transactionIndex = (String) value$; - break; - case 5: - from = (String) value$; - break; - case 6: - to = (String) value$; - break; - case 7: - value = (String) value$; - break; - case 8: - nodeName = (String) value$; - break; - case 9: - contractAddress = (String) value$; - break; - case 10: - input = (String) value$; - break; - case 11: - revertReason = (String) value$; - break; - case 12: - status = (net.consensys.eventeum.TransactionStatus) value$; - break; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - /** - * Gets the value of the 'hash' field. - * @return The value of the 'hash' field. - */ - public String getHash() { - return hash; - } - - - /** - * Sets the value of the 'hash' field. - * @param value the value to set. - */ - public void setHash(String value) { - this.hash = value; - } - - /** - * Gets the value of the 'nonce' field. - * @return The value of the 'nonce' field. - */ - public String getNonce() { - return nonce; - } - - - /** - * Sets the value of the 'nonce' field. - * @param value the value to set. - */ - public void setNonce(String value) { - this.nonce = value; - } - - /** - * Gets the value of the 'blockNumber' field. - * @return The value of the 'blockNumber' field. - */ - public String getBlockNumber() { - return blockNumber; - } - - - /** - * Sets the value of the 'blockNumber' field. - * @param value the value to set. - */ - public void setBlockNumber(String value) { - this.blockNumber = value; - } - - /** - * Gets the value of the 'blockHash' field. - * @return The value of the 'blockHash' field. - */ - public String getBlockHash() { - return blockHash; - } - - - /** - * Sets the value of the 'blockHash' field. - * @param value the value to set. - */ - public void setBlockHash(String value) { - this.blockHash = value; - } - - /** - * Gets the value of the 'transactionIndex' field. - * @return The value of the 'transactionIndex' field. - */ - public String getTransactionIndex() { - return transactionIndex; - } - - - /** - * Sets the value of the 'transactionIndex' field. - * @param value the value to set. - */ - public void setTransactionIndex(String value) { - this.transactionIndex = value; - } - - /** - * Gets the value of the 'from' field. - * @return The value of the 'from' field. - */ - public String getFrom() { - return from; - } - - - /** - * Sets the value of the 'from' field. - * @param value the value to set. - */ - public void setFrom(String value) { - this.from = value; - } - - /** - * Gets the value of the 'to' field. - * @return The value of the 'to' field. - */ - public String getTo() { - return to; - } - - - /** - * Sets the value of the 'to' field. - * @param value the value to set. - */ - public void setTo(String value) { - this.to = value; - } - - /** - * Gets the value of the 'value' field. - * @return The value of the 'value' field. - */ - public String getValue() { - return value; - } - - - /** - * Sets the value of the 'value' field. - * @param value the value to set. - */ - public void setValue(String value) { - this.value = value; - } - - /** - * Gets the value of the 'nodeName' field. - * @return The value of the 'nodeName' field. - */ - public String getNodeName() { - return nodeName; - } - - - /** - * Sets the value of the 'nodeName' field. - * @param value the value to set. - */ - public void setNodeName(String value) { - this.nodeName = value; - } - - /** - * Gets the value of the 'contractAddress' field. - * @return The value of the 'contractAddress' field. - */ - public String getContractAddress() { - return contractAddress; - } - - - /** - * Sets the value of the 'contractAddress' field. - * @param value the value to set. - */ - public void setContractAddress(String value) { - this.contractAddress = value; - } - - /** - * Gets the value of the 'input' field. - * @return The value of the 'input' field. - */ - public String getInput() { - return input; - } - - - /** - * Sets the value of the 'input' field. - * @param value the value to set. - */ - public void setInput(String value) { - this.input = value; - } - - /** - * Gets the value of the 'revertReason' field. - * @return The value of the 'revertReason' field. - */ - public String getRevertReason() { - return revertReason; - } - - - /** - * Sets the value of the 'revertReason' field. - * @param value the value to set. - */ - public void setRevertReason(String value) { - this.revertReason = value; - } - - /** - * Gets the value of the 'status' field. - * @return The value of the 'status' field. - */ - public net.consensys.eventeum.TransactionStatus getStatus() { - return status; - } - - - /** - * Sets the value of the 'status' field. - * @param value the value to set. - */ - public void setStatus(net.consensys.eventeum.TransactionStatus value) { - this.status = value; - } - - /** - * Creates a new TransactionDetails RecordBuilder. - * @return A new TransactionDetails RecordBuilder - */ - public static net.consensys.eventeum.TransactionDetails.Builder newBuilder() { - return new net.consensys.eventeum.TransactionDetails.Builder(); - } - - /** - * Creates a new TransactionDetails RecordBuilder by copying an existing Builder. - * @param other The existing builder to copy. - * @return A new TransactionDetails RecordBuilder - */ - public static net.consensys.eventeum.TransactionDetails.Builder newBuilder(net.consensys.eventeum.TransactionDetails.Builder other) { - if (other == null) { - return new net.consensys.eventeum.TransactionDetails.Builder(); - } else { - return new net.consensys.eventeum.TransactionDetails.Builder(other); - } - } - - /** - * Creates a new TransactionDetails RecordBuilder by copying an existing TransactionDetails instance. - * @param other The existing instance to copy. - * @return A new TransactionDetails RecordBuilder - */ - public static net.consensys.eventeum.TransactionDetails.Builder newBuilder(net.consensys.eventeum.TransactionDetails other) { - if (other == null) { - return new net.consensys.eventeum.TransactionDetails.Builder(); - } else { - return new net.consensys.eventeum.TransactionDetails.Builder(other); - } - } - - /** - * RecordBuilder for TransactionDetails instances. - */ - public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase - implements org.apache.avro.data.RecordBuilder { - - private String hash; - private String nonce; - private String blockNumber; - private String blockHash; - private String transactionIndex; - private String from; - private String to; - private String value; - private String nodeName; - private String contractAddress; - private String input; - private String revertReason; - private net.consensys.eventeum.TransactionStatus status; - - /** Creates a new Builder */ - private Builder() { - super(SCHEMA$); - } - - /** - * Creates a Builder by copying an existing Builder. - * @param other The existing Builder to copy. - */ - private Builder(net.consensys.eventeum.TransactionDetails.Builder other) { - super(other); - if (isValidValue(fields()[0], other.hash)) { - this.hash = data().deepCopy(fields()[0].schema(), other.hash); - fieldSetFlags()[0] = other.fieldSetFlags()[0]; - } - if (isValidValue(fields()[1], other.nonce)) { - this.nonce = data().deepCopy(fields()[1].schema(), other.nonce); - fieldSetFlags()[1] = other.fieldSetFlags()[1]; - } - if (isValidValue(fields()[2], other.blockNumber)) { - this.blockNumber = data().deepCopy(fields()[2].schema(), other.blockNumber); - fieldSetFlags()[2] = other.fieldSetFlags()[2]; - } - if (isValidValue(fields()[3], other.blockHash)) { - this.blockHash = data().deepCopy(fields()[3].schema(), other.blockHash); - fieldSetFlags()[3] = other.fieldSetFlags()[3]; - } - if (isValidValue(fields()[4], other.transactionIndex)) { - this.transactionIndex = data().deepCopy(fields()[4].schema(), other.transactionIndex); - fieldSetFlags()[4] = other.fieldSetFlags()[4]; - } - if (isValidValue(fields()[5], other.from)) { - this.from = data().deepCopy(fields()[5].schema(), other.from); - fieldSetFlags()[5] = other.fieldSetFlags()[5]; - } - if (isValidValue(fields()[6], other.to)) { - this.to = data().deepCopy(fields()[6].schema(), other.to); - fieldSetFlags()[6] = other.fieldSetFlags()[6]; - } - if (isValidValue(fields()[7], other.value)) { - this.value = data().deepCopy(fields()[7].schema(), other.value); - fieldSetFlags()[7] = other.fieldSetFlags()[7]; - } - if (isValidValue(fields()[8], other.nodeName)) { - this.nodeName = data().deepCopy(fields()[8].schema(), other.nodeName); - fieldSetFlags()[8] = other.fieldSetFlags()[8]; - } - if (isValidValue(fields()[9], other.contractAddress)) { - this.contractAddress = data().deepCopy(fields()[9].schema(), other.contractAddress); - fieldSetFlags()[9] = other.fieldSetFlags()[9]; - } - if (isValidValue(fields()[10], other.input)) { - this.input = data().deepCopy(fields()[10].schema(), other.input); - fieldSetFlags()[10] = other.fieldSetFlags()[10]; - } - if (isValidValue(fields()[11], other.revertReason)) { - this.revertReason = data().deepCopy(fields()[11].schema(), other.revertReason); - fieldSetFlags()[11] = other.fieldSetFlags()[11]; - } - if (isValidValue(fields()[12], other.status)) { - this.status = data().deepCopy(fields()[12].schema(), other.status); - fieldSetFlags()[12] = other.fieldSetFlags()[12]; - } - } - - /** - * Creates a Builder by copying an existing TransactionDetails instance - * @param other The existing instance to copy. - */ - private Builder(net.consensys.eventeum.TransactionDetails other) { - super(SCHEMA$); - if (isValidValue(fields()[0], other.hash)) { - this.hash = data().deepCopy(fields()[0].schema(), other.hash); - fieldSetFlags()[0] = true; - } - if (isValidValue(fields()[1], other.nonce)) { - this.nonce = data().deepCopy(fields()[1].schema(), other.nonce); - fieldSetFlags()[1] = true; - } - if (isValidValue(fields()[2], other.blockNumber)) { - this.blockNumber = data().deepCopy(fields()[2].schema(), other.blockNumber); - fieldSetFlags()[2] = true; - } - if (isValidValue(fields()[3], other.blockHash)) { - this.blockHash = data().deepCopy(fields()[3].schema(), other.blockHash); - fieldSetFlags()[3] = true; - } - if (isValidValue(fields()[4], other.transactionIndex)) { - this.transactionIndex = data().deepCopy(fields()[4].schema(), other.transactionIndex); - fieldSetFlags()[4] = true; - } - if (isValidValue(fields()[5], other.from)) { - this.from = data().deepCopy(fields()[5].schema(), other.from); - fieldSetFlags()[5] = true; - } - if (isValidValue(fields()[6], other.to)) { - this.to = data().deepCopy(fields()[6].schema(), other.to); - fieldSetFlags()[6] = true; - } - if (isValidValue(fields()[7], other.value)) { - this.value = data().deepCopy(fields()[7].schema(), other.value); - fieldSetFlags()[7] = true; - } - if (isValidValue(fields()[8], other.nodeName)) { - this.nodeName = data().deepCopy(fields()[8].schema(), other.nodeName); - fieldSetFlags()[8] = true; - } - if (isValidValue(fields()[9], other.contractAddress)) { - this.contractAddress = data().deepCopy(fields()[9].schema(), other.contractAddress); - fieldSetFlags()[9] = true; - } - if (isValidValue(fields()[10], other.input)) { - this.input = data().deepCopy(fields()[10].schema(), other.input); - fieldSetFlags()[10] = true; - } - if (isValidValue(fields()[11], other.revertReason)) { - this.revertReason = data().deepCopy(fields()[11].schema(), other.revertReason); - fieldSetFlags()[11] = true; - } - if (isValidValue(fields()[12], other.status)) { - this.status = data().deepCopy(fields()[12].schema(), other.status); - fieldSetFlags()[12] = true; - } - } - - /** - * Gets the value of the 'hash' field. - * @return The value. - */ - public String getHash() { - return hash; - } - - - /** - * Sets the value of the 'hash' field. - * @param value The value of 'hash'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder setHash(String value) { - validate(fields()[0], value); - this.hash = value; - fieldSetFlags()[0] = true; - return this; - } - - /** - * Checks whether the 'hash' field has been set. - * @return True if the 'hash' field has been set, false otherwise. - */ - public boolean hasHash() { - return fieldSetFlags()[0]; - } - - - /** - * Clears the value of the 'hash' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder clearHash() { - hash = null; - fieldSetFlags()[0] = false; - return this; - } - - /** - * Gets the value of the 'nonce' field. - * @return The value. - */ - public String getNonce() { - return nonce; - } - - - /** - * Sets the value of the 'nonce' field. - * @param value The value of 'nonce'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder setNonce(String value) { - validate(fields()[1], value); - this.nonce = value; - fieldSetFlags()[1] = true; - return this; - } - - /** - * Checks whether the 'nonce' field has been set. - * @return True if the 'nonce' field has been set, false otherwise. - */ - public boolean hasNonce() { - return fieldSetFlags()[1]; - } - - - /** - * Clears the value of the 'nonce' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder clearNonce() { - nonce = null; - fieldSetFlags()[1] = false; - return this; - } - - /** - * Gets the value of the 'blockNumber' field. - * @return The value. - */ - public String getBlockNumber() { - return blockNumber; - } - - - /** - * Sets the value of the 'blockNumber' field. - * @param value The value of 'blockNumber'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder setBlockNumber(String value) { - validate(fields()[2], value); - this.blockNumber = value; - fieldSetFlags()[2] = true; - return this; - } - - /** - * Checks whether the 'blockNumber' field has been set. - * @return True if the 'blockNumber' field has been set, false otherwise. - */ - public boolean hasBlockNumber() { - return fieldSetFlags()[2]; - } - - - /** - * Clears the value of the 'blockNumber' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder clearBlockNumber() { - blockNumber = null; - fieldSetFlags()[2] = false; - return this; - } - - /** - * Gets the value of the 'blockHash' field. - * @return The value. - */ - public String getBlockHash() { - return blockHash; - } - - - /** - * Sets the value of the 'blockHash' field. - * @param value The value of 'blockHash'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder setBlockHash(String value) { - validate(fields()[3], value); - this.blockHash = value; - fieldSetFlags()[3] = true; - return this; - } - - /** - * Checks whether the 'blockHash' field has been set. - * @return True if the 'blockHash' field has been set, false otherwise. - */ - public boolean hasBlockHash() { - return fieldSetFlags()[3]; - } - - - /** - * Clears the value of the 'blockHash' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder clearBlockHash() { - blockHash = null; - fieldSetFlags()[3] = false; - return this; - } - - /** - * Gets the value of the 'transactionIndex' field. - * @return The value. - */ - public String getTransactionIndex() { - return transactionIndex; - } - - - /** - * Sets the value of the 'transactionIndex' field. - * @param value The value of 'transactionIndex'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder setTransactionIndex(String value) { - validate(fields()[4], value); - this.transactionIndex = value; - fieldSetFlags()[4] = true; - return this; - } - - /** - * Checks whether the 'transactionIndex' field has been set. - * @return True if the 'transactionIndex' field has been set, false otherwise. - */ - public boolean hasTransactionIndex() { - return fieldSetFlags()[4]; - } - - - /** - * Clears the value of the 'transactionIndex' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder clearTransactionIndex() { - transactionIndex = null; - fieldSetFlags()[4] = false; - return this; - } - - /** - * Gets the value of the 'from' field. - * @return The value. - */ - public String getFrom() { - return from; - } - - - /** - * Sets the value of the 'from' field. - * @param value The value of 'from'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder setFrom(String value) { - validate(fields()[5], value); - this.from = value; - fieldSetFlags()[5] = true; - return this; - } - - /** - * Checks whether the 'from' field has been set. - * @return True if the 'from' field has been set, false otherwise. - */ - public boolean hasFrom() { - return fieldSetFlags()[5]; - } - - - /** - * Clears the value of the 'from' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder clearFrom() { - from = null; - fieldSetFlags()[5] = false; - return this; - } - - /** - * Gets the value of the 'to' field. - * @return The value. - */ - public String getTo() { - return to; - } - - - /** - * Sets the value of the 'to' field. - * @param value The value of 'to'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder setTo(String value) { - validate(fields()[6], value); - this.to = value; - fieldSetFlags()[6] = true; - return this; - } - - /** - * Checks whether the 'to' field has been set. - * @return True if the 'to' field has been set, false otherwise. - */ - public boolean hasTo() { - return fieldSetFlags()[6]; - } - - - /** - * Clears the value of the 'to' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder clearTo() { - to = null; - fieldSetFlags()[6] = false; - return this; - } - - /** - * Gets the value of the 'value' field. - * @return The value. - */ - public String getValue() { - return value; - } - - - /** - * Sets the value of the 'value' field. - * @param value The value of 'value'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder setValue(String value) { - validate(fields()[7], value); - this.value = value; - fieldSetFlags()[7] = true; - return this; - } - - /** - * Checks whether the 'value' field has been set. - * @return True if the 'value' field has been set, false otherwise. - */ - public boolean hasValue() { - return fieldSetFlags()[7]; - } - - - /** - * Clears the value of the 'value' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder clearValue() { - value = null; - fieldSetFlags()[7] = false; - return this; - } - - /** - * Gets the value of the 'nodeName' field. - * @return The value. - */ - public String getNodeName() { - return nodeName; - } - - - /** - * Sets the value of the 'nodeName' field. - * @param value The value of 'nodeName'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder setNodeName(String value) { - validate(fields()[8], value); - this.nodeName = value; - fieldSetFlags()[8] = true; - return this; - } - - /** - * Checks whether the 'nodeName' field has been set. - * @return True if the 'nodeName' field has been set, false otherwise. - */ - public boolean hasNodeName() { - return fieldSetFlags()[8]; - } - - - /** - * Clears the value of the 'nodeName' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder clearNodeName() { - nodeName = null; - fieldSetFlags()[8] = false; - return this; - } - - /** - * Gets the value of the 'contractAddress' field. - * @return The value. - */ - public String getContractAddress() { - return contractAddress; - } - - - /** - * Sets the value of the 'contractAddress' field. - * @param value The value of 'contractAddress'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder setContractAddress(String value) { - validate(fields()[9], value); - this.contractAddress = value; - fieldSetFlags()[9] = true; - return this; - } - - /** - * Checks whether the 'contractAddress' field has been set. - * @return True if the 'contractAddress' field has been set, false otherwise. - */ - public boolean hasContractAddress() { - return fieldSetFlags()[9]; - } - - - /** - * Clears the value of the 'contractAddress' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder clearContractAddress() { - contractAddress = null; - fieldSetFlags()[9] = false; - return this; - } - - /** - * Gets the value of the 'input' field. - * @return The value. - */ - public String getInput() { - return input; - } - - - /** - * Sets the value of the 'input' field. - * @param value The value of 'input'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder setInput(String value) { - validate(fields()[10], value); - this.input = value; - fieldSetFlags()[10] = true; - return this; - } - - /** - * Checks whether the 'input' field has been set. - * @return True if the 'input' field has been set, false otherwise. - */ - public boolean hasInput() { - return fieldSetFlags()[10]; - } - - - /** - * Clears the value of the 'input' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder clearInput() { - input = null; - fieldSetFlags()[10] = false; - return this; - } - - /** - * Gets the value of the 'revertReason' field. - * @return The value. - */ - public String getRevertReason() { - return revertReason; - } - - - /** - * Sets the value of the 'revertReason' field. - * @param value The value of 'revertReason'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder setRevertReason(String value) { - validate(fields()[11], value); - this.revertReason = value; - fieldSetFlags()[11] = true; - return this; - } - - /** - * Checks whether the 'revertReason' field has been set. - * @return True if the 'revertReason' field has been set, false otherwise. - */ - public boolean hasRevertReason() { - return fieldSetFlags()[11]; - } - - - /** - * Clears the value of the 'revertReason' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder clearRevertReason() { - revertReason = null; - fieldSetFlags()[11] = false; - return this; - } - - /** - * Gets the value of the 'status' field. - * @return The value. - */ - public net.consensys.eventeum.TransactionStatus getStatus() { - return status; - } - - - /** - * Sets the value of the 'status' field. - * @param value The value of 'status'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder setStatus(net.consensys.eventeum.TransactionStatus value) { - validate(fields()[12], value); - this.status = value; - fieldSetFlags()[12] = true; - return this; - } - - /** - * Checks whether the 'status' field has been set. - * @return True if the 'status' field has been set, false otherwise. - */ - public boolean hasStatus() { - return fieldSetFlags()[12]; - } - - - /** - * Clears the value of the 'status' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder clearStatus() { - status = null; - fieldSetFlags()[12] = false; - return this; - } - - @Override - @SuppressWarnings("unchecked") - public TransactionDetails build() { - try { - TransactionDetails record = new TransactionDetails(); - record.hash = fieldSetFlags()[0] ? this.hash : (String) defaultValue(fields()[0]); - record.nonce = fieldSetFlags()[1] ? this.nonce : (String) defaultValue(fields()[1]); - record.blockNumber = fieldSetFlags()[2] ? this.blockNumber : (String) defaultValue(fields()[2]); - record.blockHash = fieldSetFlags()[3] ? this.blockHash : (String) defaultValue(fields()[3]); - record.transactionIndex = fieldSetFlags()[4] ? this.transactionIndex : (String) defaultValue(fields()[4]); - record.from = fieldSetFlags()[5] ? this.from : (String) defaultValue(fields()[5]); - record.to = fieldSetFlags()[6] ? this.to : (String) defaultValue(fields()[6]); - record.value = fieldSetFlags()[7] ? this.value : (String) defaultValue(fields()[7]); - record.nodeName = fieldSetFlags()[8] ? this.nodeName : (String) defaultValue(fields()[8]); - record.contractAddress = fieldSetFlags()[9] ? this.contractAddress : (String) defaultValue(fields()[9]); - record.input = fieldSetFlags()[10] ? this.input : (String) defaultValue(fields()[10]); - record.revertReason = fieldSetFlags()[11] ? this.revertReason : (String) defaultValue(fields()[11]); - record.status = fieldSetFlags()[12] ? this.status : (net.consensys.eventeum.TransactionStatus) defaultValue(fields()[12]); - return record; - } catch (org.apache.avro.AvroMissingFieldException e) { - throw e; - } catch (Exception e) { - throw new org.apache.avro.AvroRuntimeException(e); - } - } - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter) MODEL$.createDatumWriter(SCHEMA$); - - @Override - public void writeExternal(java.io.ObjectOutput out) - throws java.io.IOException { - WRITER$.write(this, SpecificData.getEncoder(out)); - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader) MODEL$.createDatumReader(SCHEMA$); - - @Override - public void readExternal(java.io.ObjectInput in) - throws java.io.IOException { - READER$.read(this, SpecificData.getDecoder(in)); - } - - @Override - protected boolean hasCustomCoders() { - return true; - } - - @Override - public void customEncode(org.apache.avro.io.Encoder out) - throws java.io.IOException { - out.writeString(this.hash); - - out.writeString(this.nonce); - - out.writeString(this.blockNumber); - - out.writeString(this.blockHash); - - out.writeString(this.transactionIndex); - - out.writeString(this.from); - - out.writeString(this.to); - - out.writeString(this.value); - - out.writeString(this.nodeName); - - out.writeString(this.contractAddress); - - out.writeString(this.input); - - out.writeString(this.revertReason); - - out.writeEnum(this.status.ordinal()); - - } - - @Override - public void customDecode(org.apache.avro.io.ResolvingDecoder in) - throws java.io.IOException { - org.apache.avro.Schema.Field[] fieldOrder = in.readFieldOrderIfDiff(); - if (fieldOrder == null) { - this.hash = in.readString(); - - this.nonce = in.readString(); - - this.blockNumber = in.readString(); - - this.blockHash = in.readString(); - - this.transactionIndex = in.readString(); - - this.from = in.readString(); - - this.to = in.readString(); - - this.value = in.readString(); - - this.nodeName = in.readString(); - - this.contractAddress = in.readString(); - - this.input = in.readString(); - - this.revertReason = in.readString(); - - this.status = net.consensys.eventeum.TransactionStatus.values()[in.readEnum()]; - - } else { - for (int i = 0; i < 13; i++) { - switch (fieldOrder[i].pos()) { - case 0: - this.hash = in.readString(); - break; - - case 1: - this.nonce = in.readString(); - break; - - case 2: - this.blockNumber = in.readString(); - break; - - case 3: - this.blockHash = in.readString(); - break; - - case 4: - this.transactionIndex = in.readString(); - break; - - case 5: - this.from = in.readString(); - break; - - case 6: - this.to = in.readString(); - break; - - case 7: - this.value = in.readString(); - break; - - case 8: - this.nodeName = in.readString(); - break; - - case 9: - this.contractAddress = in.readString(); - break; - - case 10: - this.input = in.readString(); - break; - - case 11: - this.revertReason = in.readString(); - break; - - case 12: - this.status = net.consensys.eventeum.TransactionStatus.values()[in.readEnum()]; - break; - - default: - throw new java.io.IOException("Corrupt ResolvingDecoder."); - } - } - } - } -} - - - - - - - - - - diff --git a/src/main/java/net/consensys/eventeum/TransactionEvent.java b/src/main/java/net/consensys/eventeum/TransactionEvent.java deleted file mode 100644 index 2ac16e9..0000000 --- a/src/main/java/net/consensys/eventeum/TransactionEvent.java +++ /dev/null @@ -1,635 +0,0 @@ -/** - * Autogenerated by Avro - *

- * DO NOT EDIT DIRECTLY - */ -package net.consensys.eventeum; - -import org.apache.avro.message.BinaryMessageDecoder; -import org.apache.avro.message.BinaryMessageEncoder; -import org.apache.avro.message.SchemaStore; -import org.apache.avro.specific.SpecificData; - -@org.apache.avro.specific.AvroGenerated -public class TransactionEvent extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord { - private static final long serialVersionUID = -1439422860764450147L; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"TransactionEvent\",\"namespace\":\"net.consensys.eventeum\",\"fields\":[{\"name\":\"id\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"type\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"details\",\"type\":{\"type\":\"record\",\"name\":\"TransactionDetails\",\"fields\":[{\"name\":\"hash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nonce\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"blockNumber\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"blockHash\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"transactionIndex\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"from\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"to\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"value\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"nodeName\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"contractAddress\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"input\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"revertReason\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"}},{\"name\":\"status\",\"type\":{\"type\":\"enum\",\"name\":\"TransactionStatus\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\",\"FAILED\"]}}]}},{\"name\":\"retries\",\"type\":\"int\"}]}"); - - public static org.apache.avro.Schema getClassSchema() { - return SCHEMA$; - } - - private static SpecificData MODEL$ = new SpecificData(); - - private static final BinaryMessageEncoder ENCODER = - new BinaryMessageEncoder(MODEL$, SCHEMA$); - - private static final BinaryMessageDecoder DECODER = - new BinaryMessageDecoder(MODEL$, SCHEMA$); - - /** - * Return the BinaryMessageEncoder instance used by this class. - * @return the message encoder used by this class - */ - public static BinaryMessageEncoder getEncoder() { - return ENCODER; - } - - /** - * Return the BinaryMessageDecoder instance used by this class. - * @return the message decoder used by this class - */ - public static BinaryMessageDecoder getDecoder() { - return DECODER; - } - - /** - * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}. - * @param resolver a {@link SchemaStore} used to find schemas by fingerprint - * @return a BinaryMessageDecoder instance for this class backed by the given SchemaStore - */ - public static BinaryMessageDecoder createDecoder(SchemaStore resolver) { - return new BinaryMessageDecoder(MODEL$, SCHEMA$, resolver); - } - - /** - * Serializes this TransactionEvent to a ByteBuffer. - * @return a buffer holding the serialized data for this instance - * @throws java.io.IOException if this instance could not be serialized - */ - public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException { - return ENCODER.encode(this); - } - - /** - * Deserializes a TransactionEvent from a ByteBuffer. - * @param b a byte buffer holding serialized data for an instance of this class - * @return a TransactionEvent instance decoded from the given buffer - * @throws java.io.IOException if the given bytes could not be deserialized into an instance of this class - */ - public static TransactionEvent fromByteBuffer( - java.nio.ByteBuffer b) throws java.io.IOException { - return DECODER.decode(b); - } - - @Deprecated - public String id; - @Deprecated - public String type; - @Deprecated - public net.consensys.eventeum.TransactionDetails details; - @Deprecated - public int retries; - - /** - * Default constructor. Note that this does not initialize fields - * to their default values from the schema. If that is desired then - * one should use newBuilder(). - */ - public TransactionEvent() { - } - - /** - * All-args constructor. - * @param id The new value for id - * @param type The new value for type - * @param details The new value for details - * @param retries The new value for retries - */ - public TransactionEvent(String id, String type, net.consensys.eventeum.TransactionDetails details, Integer retries) { - this.id = id; - this.type = type; - this.details = details; - this.retries = retries; - } - - public org.apache.avro.specific.SpecificData getSpecificData() { - return MODEL$; - } - - public org.apache.avro.Schema getSchema() { - return SCHEMA$; - } - - // Used by DatumWriter. Applications should not call. - public Object get(int field$) { - switch (field$) { - case 0: - return id; - case 1: - return type; - case 2: - return details; - case 3: - return retries; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - // Used by DatumReader. Applications should not call. - @SuppressWarnings(value = "unchecked") - public void put(int field$, Object value$) { - switch (field$) { - case 0: - id = (String) value$; - break; - case 1: - type = (String) value$; - break; - case 2: - details = (net.consensys.eventeum.TransactionDetails) value$; - break; - case 3: - retries = (Integer) value$; - break; - default: - throw new org.apache.avro.AvroRuntimeException("Bad index"); - } - } - - /** - * Gets the value of the 'id' field. - * @return The value of the 'id' field. - */ - public String getId() { - return id; - } - - - /** - * Sets the value of the 'id' field. - * @param value the value to set. - */ - public void setId(String value) { - this.id = value; - } - - /** - * Gets the value of the 'type' field. - * @return The value of the 'type' field. - */ - public String getType() { - return type; - } - - - /** - * Sets the value of the 'type' field. - * @param value the value to set. - */ - public void setType(String value) { - this.type = value; - } - - /** - * Gets the value of the 'details' field. - * @return The value of the 'details' field. - */ - public net.consensys.eventeum.TransactionDetails getDetails() { - return details; - } - - - /** - * Sets the value of the 'details' field. - * @param value the value to set. - */ - public void setDetails(net.consensys.eventeum.TransactionDetails value) { - this.details = value; - } - - /** - * Gets the value of the 'retries' field. - * @return The value of the 'retries' field. - */ - public int getRetries() { - return retries; - } - - - /** - * Sets the value of the 'retries' field. - * @param value the value to set. - */ - public void setRetries(int value) { - this.retries = value; - } - - /** - * Creates a new TransactionEvent RecordBuilder. - * @return A new TransactionEvent RecordBuilder - */ - public static net.consensys.eventeum.TransactionEvent.Builder newBuilder() { - return new net.consensys.eventeum.TransactionEvent.Builder(); - } - - /** - * Creates a new TransactionEvent RecordBuilder by copying an existing Builder. - * @param other The existing builder to copy. - * @return A new TransactionEvent RecordBuilder - */ - public static net.consensys.eventeum.TransactionEvent.Builder newBuilder(net.consensys.eventeum.TransactionEvent.Builder other) { - if (other == null) { - return new net.consensys.eventeum.TransactionEvent.Builder(); - } else { - return new net.consensys.eventeum.TransactionEvent.Builder(other); - } - } - - /** - * Creates a new TransactionEvent RecordBuilder by copying an existing TransactionEvent instance. - * @param other The existing instance to copy. - * @return A new TransactionEvent RecordBuilder - */ - public static net.consensys.eventeum.TransactionEvent.Builder newBuilder(net.consensys.eventeum.TransactionEvent other) { - if (other == null) { - return new net.consensys.eventeum.TransactionEvent.Builder(); - } else { - return new net.consensys.eventeum.TransactionEvent.Builder(other); - } - } - - /** - * RecordBuilder for TransactionEvent instances. - */ - public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase - implements org.apache.avro.data.RecordBuilder { - - private String id; - private String type; - private net.consensys.eventeum.TransactionDetails details; - private net.consensys.eventeum.TransactionDetails.Builder detailsBuilder; - private int retries; - - /** Creates a new Builder */ - private Builder() { - super(SCHEMA$); - } - - /** - * Creates a Builder by copying an existing Builder. - * @param other The existing Builder to copy. - */ - private Builder(net.consensys.eventeum.TransactionEvent.Builder other) { - super(other); - if (isValidValue(fields()[0], other.id)) { - this.id = data().deepCopy(fields()[0].schema(), other.id); - fieldSetFlags()[0] = other.fieldSetFlags()[0]; - } - if (isValidValue(fields()[1], other.type)) { - this.type = data().deepCopy(fields()[1].schema(), other.type); - fieldSetFlags()[1] = other.fieldSetFlags()[1]; - } - if (isValidValue(fields()[2], other.details)) { - this.details = data().deepCopy(fields()[2].schema(), other.details); - fieldSetFlags()[2] = other.fieldSetFlags()[2]; - } - if (other.hasDetailsBuilder()) { - this.detailsBuilder = net.consensys.eventeum.TransactionDetails.newBuilder(other.getDetailsBuilder()); - } - if (isValidValue(fields()[3], other.retries)) { - this.retries = data().deepCopy(fields()[3].schema(), other.retries); - fieldSetFlags()[3] = other.fieldSetFlags()[3]; - } - } - - /** - * Creates a Builder by copying an existing TransactionEvent instance - * @param other The existing instance to copy. - */ - private Builder(net.consensys.eventeum.TransactionEvent other) { - super(SCHEMA$); - if (isValidValue(fields()[0], other.id)) { - this.id = data().deepCopy(fields()[0].schema(), other.id); - fieldSetFlags()[0] = true; - } - if (isValidValue(fields()[1], other.type)) { - this.type = data().deepCopy(fields()[1].schema(), other.type); - fieldSetFlags()[1] = true; - } - if (isValidValue(fields()[2], other.details)) { - this.details = data().deepCopy(fields()[2].schema(), other.details); - fieldSetFlags()[2] = true; - } - this.detailsBuilder = null; - if (isValidValue(fields()[3], other.retries)) { - this.retries = data().deepCopy(fields()[3].schema(), other.retries); - fieldSetFlags()[3] = true; - } - } - - /** - * Gets the value of the 'id' field. - * @return The value. - */ - public String getId() { - return id; - } - - - /** - * Sets the value of the 'id' field. - * @param value The value of 'id'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionEvent.Builder setId(String value) { - validate(fields()[0], value); - this.id = value; - fieldSetFlags()[0] = true; - return this; - } - - /** - * Checks whether the 'id' field has been set. - * @return True if the 'id' field has been set, false otherwise. - */ - public boolean hasId() { - return fieldSetFlags()[0]; - } - - - /** - * Clears the value of the 'id' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionEvent.Builder clearId() { - id = null; - fieldSetFlags()[0] = false; - return this; - } - - /** - * Gets the value of the 'type' field. - * @return The value. - */ - public String getType() { - return type; - } - - - /** - * Sets the value of the 'type' field. - * @param value The value of 'type'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionEvent.Builder setType(String value) { - validate(fields()[1], value); - this.type = value; - fieldSetFlags()[1] = true; - return this; - } - - /** - * Checks whether the 'type' field has been set. - * @return True if the 'type' field has been set, false otherwise. - */ - public boolean hasType() { - return fieldSetFlags()[1]; - } - - - /** - * Clears the value of the 'type' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionEvent.Builder clearType() { - type = null; - fieldSetFlags()[1] = false; - return this; - } - - /** - * Gets the value of the 'details' field. - * @return The value. - */ - public net.consensys.eventeum.TransactionDetails getDetails() { - return details; - } - - - /** - * Sets the value of the 'details' field. - * @param value The value of 'details'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionEvent.Builder setDetails(net.consensys.eventeum.TransactionDetails value) { - validate(fields()[2], value); - this.detailsBuilder = null; - this.details = value; - fieldSetFlags()[2] = true; - return this; - } - - /** - * Checks whether the 'details' field has been set. - * @return True if the 'details' field has been set, false otherwise. - */ - public boolean hasDetails() { - return fieldSetFlags()[2]; - } - - /** - * Gets the Builder instance for the 'details' field and creates one if it doesn't exist yet. - * @return This builder. - */ - public net.consensys.eventeum.TransactionDetails.Builder getDetailsBuilder() { - if (detailsBuilder == null) { - if (hasDetails()) { - setDetailsBuilder(net.consensys.eventeum.TransactionDetails.newBuilder(details)); - } else { - setDetailsBuilder(net.consensys.eventeum.TransactionDetails.newBuilder()); - } - } - return detailsBuilder; - } - - /** - * Sets the Builder instance for the 'details' field - * @param value The builder instance that must be set. - * @return This builder. - */ - public net.consensys.eventeum.TransactionEvent.Builder setDetailsBuilder(net.consensys.eventeum.TransactionDetails.Builder value) { - clearDetails(); - detailsBuilder = value; - return this; - } - - /** - * Checks whether the 'details' field has an active Builder instance - * @return True if the 'details' field has an active Builder instance - */ - public boolean hasDetailsBuilder() { - return detailsBuilder != null; - } - - /** - * Clears the value of the 'details' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionEvent.Builder clearDetails() { - details = null; - detailsBuilder = null; - fieldSetFlags()[2] = false; - return this; - } - - /** - * Gets the value of the 'retries' field. - * @return The value. - */ - public int getRetries() { - return retries; - } - - - /** - * Sets the value of the 'retries' field. - * @param value The value of 'retries'. - * @return This builder. - */ - public net.consensys.eventeum.TransactionEvent.Builder setRetries(int value) { - validate(fields()[3], value); - this.retries = value; - fieldSetFlags()[3] = true; - return this; - } - - /** - * Checks whether the 'retries' field has been set. - * @return True if the 'retries' field has been set, false otherwise. - */ - public boolean hasRetries() { - return fieldSetFlags()[3]; - } - - - /** - * Clears the value of the 'retries' field. - * @return This builder. - */ - public net.consensys.eventeum.TransactionEvent.Builder clearRetries() { - fieldSetFlags()[3] = false; - return this; - } - - @Override - @SuppressWarnings("unchecked") - public TransactionEvent build() { - try { - TransactionEvent record = new TransactionEvent(); - record.id = fieldSetFlags()[0] ? this.id : (String) defaultValue(fields()[0]); - record.type = fieldSetFlags()[1] ? this.type : (String) defaultValue(fields()[1]); - if (detailsBuilder != null) { - try { - record.details = this.detailsBuilder.build(); - } catch (org.apache.avro.AvroMissingFieldException e) { - e.addParentField(record.getSchema().getField("details")); - throw e; - } - } else { - record.details = fieldSetFlags()[2] ? this.details : (net.consensys.eventeum.TransactionDetails) defaultValue(fields()[2]); - } - record.retries = fieldSetFlags()[3] ? this.retries : (Integer) defaultValue(fields()[3]); - return record; - } catch (org.apache.avro.AvroMissingFieldException e) { - throw e; - } catch (Exception e) { - throw new org.apache.avro.AvroRuntimeException(e); - } - } - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumWriter - WRITER$ = (org.apache.avro.io.DatumWriter) MODEL$.createDatumWriter(SCHEMA$); - - @Override - public void writeExternal(java.io.ObjectOutput out) - throws java.io.IOException { - WRITER$.write(this, SpecificData.getEncoder(out)); - } - - @SuppressWarnings("unchecked") - private static final org.apache.avro.io.DatumReader - READER$ = (org.apache.avro.io.DatumReader) MODEL$.createDatumReader(SCHEMA$); - - @Override - public void readExternal(java.io.ObjectInput in) - throws java.io.IOException { - READER$.read(this, SpecificData.getDecoder(in)); - } - - @Override - protected boolean hasCustomCoders() { - return true; - } - - @Override - public void customEncode(org.apache.avro.io.Encoder out) - throws java.io.IOException { - out.writeString(this.id); - - out.writeString(this.type); - - this.details.customEncode(out); - - out.writeInt(this.retries); - - } - - @Override - public void customDecode(org.apache.avro.io.ResolvingDecoder in) - throws java.io.IOException { - org.apache.avro.Schema.Field[] fieldOrder = in.readFieldOrderIfDiff(); - if (fieldOrder == null) { - this.id = in.readString(); - - this.type = in.readString(); - - if (this.details == null) { - this.details = new net.consensys.eventeum.TransactionDetails(); - } - this.details.customDecode(in); - - this.retries = in.readInt(); - - } else { - for (int i = 0; i < 4; i++) { - switch (fieldOrder[i].pos()) { - case 0: - this.id = in.readString(); - break; - - case 1: - this.type = in.readString(); - break; - - case 2: - if (this.details == null) { - this.details = new net.consensys.eventeum.TransactionDetails(); - } - this.details.customDecode(in); - break; - - case 3: - this.retries = in.readInt(); - break; - - default: - throw new java.io.IOException("Corrupt ResolvingDecoder."); - } - } - } - } -} - - - - - - - - - - diff --git a/src/main/java/net/consensys/eventeum/TransactionStatus.java b/src/main/java/net/consensys/eventeum/TransactionStatus.java deleted file mode 100644 index 128e8b6..0000000 --- a/src/main/java/net/consensys/eventeum/TransactionStatus.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Autogenerated by Avro - *

- * DO NOT EDIT DIRECTLY - */ -package net.consensys.eventeum; - -@org.apache.avro.specific.AvroGenerated -public enum TransactionStatus implements org.apache.avro.generic.GenericEnumSymbol { - UNCONFIRMED, CONFIRMED, INVALIDATED, FAILED; - public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"enum\",\"name\":\"TransactionStatus\",\"namespace\":\"net.consensys.eventeum\",\"symbols\":[\"UNCONFIRMED\",\"CONFIRMED\",\"INVALIDATED\",\"FAILED\"]}"); - - public static org.apache.avro.Schema getClassSchema() { - return SCHEMA$; - } - - public org.apache.avro.Schema getSchema() { - return SCHEMA$; - } -} diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf index c2f3e1d..a9974cf 100644 --- a/src/main/resources/application.conf +++ b/src/main/resources/application.conf @@ -4,8 +4,9 @@ kafka { block-topic = "block-events" event-block-topic = "event-block" flat-event-topic = "flat-events" - accounts-aggregation-topic = "accounts-created-byday" + accounts-aggregation-topic = "accounts-created-window_minute" + alerts-topic = "alerts" } schema-registry { url = "http://localhost:18081" -} \ No newline at end of file +} diff --git a/src/test/java/io/keyko/monitoring/EventProcessorTest.java b/src/test/java/io/keyko/monitoring/EventProcessorTest.java index 846d46e..fc1f5f8 100644 --- a/src/test/java/io/keyko/monitoring/EventProcessorTest.java +++ b/src/test/java/io/keyko/monitoring/EventProcessorTest.java @@ -2,8 +2,8 @@ import io.confluent.kafka.serializers.AbstractKafkaAvroSerDeConfig; import io.confluent.kafka.streams.serdes.avro.SpecificAvroSerde; +import io.keyko.monitoring.schemas.*; import io.keyko.monitoring.stream.EventProcessor; -import net.consensys.eventeum.*; import org.apache.kafka.common.serialization.Serde; import org.apache.kafka.common.serialization.Serdes; import org.apache.kafka.common.serialization.StringDeserializer; @@ -11,6 +11,7 @@ import org.apache.kafka.streams.*; import org.apache.kafka.streams.kstream.KStream; import org.apache.kafka.streams.kstream.KTable; +import org.apache.kafka.streams.kstream.Produced; import org.junit.Before; import org.junit.Test; @@ -54,9 +55,29 @@ public class EventProcessorTest { public EventBlock oracleReportedEventWithBlock = new EventBlock("0x27bc3eda4e3eaae838dd44f4a9fd4564f4455c51e336daa4232afd4ea190f0f1-0x73090d8e7bb7b2a2b550474c2c90e8059d9bfdcd752c5fc55af18f54debfb88d-0", "", oracleReportedDetails, blockOracleReportedDetails, 0); + public ContractEventDetails epochrewardsdistributedtovotersDetails = new ContractEventDetails("EpochRewardsDistributedToVoters", "EpochRewardsDistributedToVoters", "default", + Collections.singletonList(new StringParameter("group", "address", "VG3")), + Collections.singletonList(new NumberParameter("value", "uint256", "0")), "0x294d73910e7c1e7cd8f0bf341e513c0269a089b36c22c2ac006269eb59e6e6be", + "0", "43", "0x8ce40858181dccf410331c4b3edf0187ac7b887aeb5c6e0bce2dbc09635f470e", "0xC03c31f91b893317C786AB6b6A2a6BdD61db9c55", ContractEventStatus.CONFIRMED, + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "default", + "43"); + public BlockDetails blockEpochrewardsdistributedtovotersDetails = new BlockDetails("43", "0x8ce40858181dccf410331c4b3edf0187ac7b887aeb5c6e0bce2dbc09635f470e", "1234", "default"); + public EventBlock epochrewardsdistributedtovotersEventWithBlock = new EventBlock("43", "", epochrewardsdistributedtovotersDetails, blockEpochrewardsdistributedtovotersDetails, 0); + + public ContractEventDetails epochrewardsdistributedtovotersDetails1 = new ContractEventDetails("EpochRewardsDistributedToVoters", "EpochRewardsDistributedToVoters", "default", + Collections.singletonList(new StringParameter("group", "address", "VG3")), + Collections.singletonList(new NumberParameter("value", "uint256", "3")), "0x294d73910e7c1e7cd8f0bf341e513c0269a089b36c22c2ac006269eb59e6e6be", + "0", "45", "0x8ce40858181dccf410331c4b3edf0187ac7b887aeb5c6e0bce2dbc09635f470e", "0xC03c31f91b893317C786AB6b6A2a6BdD61db9c55", ContractEventStatus.CONFIRMED, + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "default", + "45"); + public BlockDetails blockEpochrewardsdistributedtovotersDetails1 = new BlockDetails("45", "0x8ce40858181dccf410331c4b3edf0187ac7b887aeb5c6e0bce2dbc09635f470e", "1234", "default"); + public EventBlock epochrewardsdistributedtovotersEventWithBlock1 = new EventBlock("45", "", epochrewardsdistributedtovotersDetails1, blockEpochrewardsdistributedtovotersDetails1, 0); + + final Serde eventAvroSerde = new SpecificAvroSerde<>(); final Serde blockAvroSerde = new SpecificAvroSerde(); final Serde eventBlockAvroSerde = new SpecificAvroSerde<>(); + final Serde alertAvroSerde = new SpecificAvroSerde<>(); private StreamsBuilder builder; @@ -74,6 +95,7 @@ public void before() { eventAvroSerde.configure(conf, false); blockAvroSerde.configure(conf, false); eventBlockAvroSerde.configure(conf, false); + alertAvroSerde.configure(conf, false); builder = new StreamsBuilder(); } @@ -121,4 +143,21 @@ public void splitConfirmedTopics() { assertEquals(oracleReportedTopic.readValue().getId(), oracleReportedEventWithBlock.getId()); driver.close(); } + + @Test + public void shouldReleaseAlertWhenRewardsAreZero() { + new EventProcessor().alertNoEpochRewardsDistributed(builder, Collections.singletonList("epochrewardsdistributedtovoters"), eventBlockAvroSerde).to("w3m-alerts", Produced.with(Serdes.String(), alertAvroSerde)); + Topology topology = builder.build(); + TopologyTestDriver driver = new TopologyTestDriver(topology, config); + TestInputTopic inputTopicValidatorRegistered = driver.createInputTopic("epochrewardsdistributedtovoters", new StringSerializer(), eventBlockAvroSerde.serializer()); + inputTopicValidatorRegistered.pipeInput(epochrewardsdistributedtovotersEventWithBlock.getId(), epochrewardsdistributedtovotersEventWithBlock); + inputTopicValidatorRegistered.pipeInput(epochrewardsdistributedtovotersEventWithBlock1.getId(), epochrewardsdistributedtovotersEventWithBlock1); + + TestOutputTopic transferTopic = driver.createOutputTopic("w3m-alerts", new StringDeserializer(), alertAvroSerde.deserializer()); + assertEquals(transferTopic.readKeyValue().key,epochrewardsdistributedtovotersEventWithBlock.getId()); + + driver.close(); + + } + } diff --git a/src/test/resources/application.conf b/src/test/resources/application.conf index c2f3e1d..e126a2e 100644 --- a/src/test/resources/application.conf +++ b/src/test/resources/application.conf @@ -5,7 +5,8 @@ kafka { event-block-topic = "event-block" flat-event-topic = "flat-events" accounts-aggregation-topic = "accounts-created-byday" + alerts-topic = "w3m-alerts" } schema-registry { url = "http://localhost:18081" -} \ No newline at end of file +}