Skip to content

Commit

Permalink
Merge pull request #243 from joanesespanol/android
Browse files Browse the repository at this point in the history
Android
  • Loading branch information
conor10 authored Nov 15, 2017
2 parents 001c1cd + ea970f9 commit c49a4ff
Show file tree
Hide file tree
Showing 201 changed files with 4,999 additions and 478 deletions.
287 changes: 171 additions & 116 deletions README.rst

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions abi/src/main/java/org/web3j/abi/FunctionReturnDecoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public static List<Type> decode(
* @param <T> type of TypeReference
* @return the decode value
*/
@SuppressWarnings("unchecked")
public static <T extends Type> Type decodeIndexedValue(
String rawInput, TypeReference<T> typeReference) {
String input = Numeric.cleanHexPrefix(rawInput);
Expand Down Expand Up @@ -94,6 +95,7 @@ private static List<Type> build(
int offset = 0;
for (TypeReference<?> typeReference:outputParameters) {
try {
@SuppressWarnings("unchecked")
Class<Type> type = (Class<Type>) typeReference.getClassType();

int hexStringDataOffset = getDataOffset(input, offset, type);
Expand Down
3 changes: 3 additions & 0 deletions abi/src/main/java/org/web3j/abi/TypeDecoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ static <T extends Type> T decodeStaticArray(
return decodeArrayElements(input, offset, typeReference, length, false);
}

@SuppressWarnings("unchecked")
private static <T extends Type> T instantiateStaticArray(
TypeReference<T> typeReference, List<T> elements) {
try {
Expand All @@ -247,6 +248,7 @@ private static <T extends Type> T instantiateStaticArray(
}
}

@SuppressWarnings("unchecked")
private static <T extends Type> T instantiateStaticArray(List<T> elements) {
return (T) new StaticArray<T>(elements);
}
Expand All @@ -261,6 +263,7 @@ static <T extends Type> T decodeDynamicArray(
return decodeArrayElements(input, valueOffset, typeReference, length, true);
}

@SuppressWarnings("unchecked")
private static <T extends Type> T decodeArrayElements(
String input, int offset, TypeReference<T> typeReference, int length,
boolean isDynamic) {
Expand Down
1 change: 1 addition & 0 deletions abi/src/main/java/org/web3j/abi/TypeEncoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ static boolean isDynamic(Type parameter) {
|| parameter instanceof DynamicArray;
}

@SuppressWarnings("unchecked")
public static String encode(Type parameter) {
if (parameter instanceof NumericType) {
return encodeNumeric(((NumericType) parameter));
Expand Down
1 change: 1 addition & 0 deletions abi/src/main/java/org/web3j/abi/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ static <T extends Type, U extends Type> String getParameterizedTypeName(
}
}

@SuppressWarnings("unchecked")
static <T extends Type> Class<T> getParameterizedTypeFromArray(
TypeReference typeReference) throws ClassNotFoundException {

Expand Down
1 change: 1 addition & 0 deletions abi/src/main/java/org/web3j/abi/datatypes/Array.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public abstract class Array<T extends Type> implements Type<List<T>> {
private String type;
protected final List<T> value;

@SafeVarargs
Array(String type, T... values) {
if (!valid(values, type)) {
throw new UnsupportedOperationException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
public class DynamicArray<T extends Type> extends Array<T> {

@SafeVarargs
public DynamicArray(T... values) {
super(values[0].getTypeAsString() + "[]", values);
}
Expand Down
2 changes: 2 additions & 0 deletions abi/src/main/java/org/web3j/abi/datatypes/StaticArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ public class StaticArray<T extends Type> extends Array<T> {

private Integer expectedSize;

@SafeVarargs
public StaticArray(T... values) {
super(values[0].getTypeAsString() + "[" + values.length + "]", values);
isValid();
}

@SafeVarargs
public StaticArray(int expectedSize, T... values) {
super(values[0].getTypeAsString() + "[" + values.length + "]", values);
this.expectedSize = expectedSize;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.math.BigInteger;

import org.web3j.abi.datatypes.Int;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.util.List;

import org.web3j.abi.datatypes.StaticArray;
import org.web3j.abi.datatypes.Type;

Expand All @@ -16,6 +15,7 @@ public StaticArray1(List<T> values) {
super(1, values);
}

@SafeVarargs
public StaticArray1(T... values) {
super(1, values);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.util.List;

import org.web3j.abi.datatypes.StaticArray;
import org.web3j.abi.datatypes.Type;

Expand All @@ -16,6 +15,7 @@ public StaticArray10(List<T> values) {
super(10, values);
}

@SafeVarargs
public StaticArray10(T... values) {
super(10, values);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.web3j.abi.datatypes.generated;

import java.util.List;

import org.web3j.abi.datatypes.StaticArray;
import org.web3j.abi.datatypes.Type;

Expand All @@ -16,6 +15,7 @@ public StaticArray11(List<T> values) {
super(11, values);
}

@SafeVarargs
public StaticArray11(T... values) {
super(11, values);
}
Expand Down
Loading

0 comments on commit c49a4ff

Please sign in to comment.