Skip to content

Commit

Permalink
1.7.7
Browse files Browse the repository at this point in the history
    Improvements and bug fix.
  • Loading branch information
landawn committed Jun 15, 2019
1 parent 3166497 commit 1ff7e6e
Show file tree
Hide file tree
Showing 72 changed files with 1,204 additions and 741 deletions.
2 changes: 1 addition & 1 deletion .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<classpathentry kind="src" path="schema"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="lib" path="lib/abacus-util-1.7.6.jar"/>
<classpathentry kind="lib" path="lib/abacus-util-1.7.7.jar"/>
<classpathentry kind="lib" path="lib/log4j-1.2-api-2.3.jar"/>
<classpathentry kind="lib" path="lib/log4j-api-2.3.jar"/>
<classpathentry kind="lib" path="lib/log4j-core-2.3.jar"/>
Expand Down
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### 1.7.7

* Improvements and bug fix.


### 1.7.6

* Support `JsonXmlField`.
Expand Down
66 changes: 33 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,33 +183,33 @@ A general programming library in Java/Android. It's easy to learn and simple to
[RemoteExecutor](https://cdn.rawgit.com/landawn/AbacusUtil/master/docs/RemoteExecutor_view.html).

* More:
[Charsets](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/Charsets.html),
[Ascii](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/Ascii.html),
[CalendarUnit](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/CalendarUnit.html),
[NamingPolicy](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/NamingPolicy.html),
[Properties](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/Properties.html),
[PropertiesUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/PropertiesUtil.html),
[Wrapper](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/Wrapper.html),
[ArrayHashSet](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/ArrayHashSet.html),
[ArrayHashMap](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/ArrayHashMap.html),
[ClassUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/ClassUtil.html),
[EscapeUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/EscapeUtil.html),
[RegExUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/RegExUtil.html),
[FilenameUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/FilenameUtil.html),
[AWSJSONUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/AWSJSONUtil.html),
[AddrUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/AddrUtil.html),
[WSSecurityUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/WSSecurityUtil.html),
[EmailUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/EmailUtil.html),
[IEEE754rUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/IEEE754rUtil.html),
[Timed](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/Timed.html),
[Index](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/Index.html),
[Median](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/Median.html),
[f](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/f.html),
[Matth](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/Matth.html),
[SafeInitializer](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/SafeInitializer.html),
[Stopwatch](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/Stopwatch.html),
[RateLimiter](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/RateLimiter.html),
[Traverser](https://static.javadoc.io/com.landawn/abacus-util/1.7.6/com/landawn/abacus/util/Traverser.html)(from Apache commons, Google Guava...) ...
[Charsets](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/Charsets.html),
[Ascii](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/Ascii.html),
[CalendarUnit](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/CalendarUnit.html),
[NamingPolicy](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/NamingPolicy.html),
[Properties](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/Properties.html),
[PropertiesUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/PropertiesUtil.html),
[Wrapper](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/Wrapper.html),
[ArrayHashSet](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/ArrayHashSet.html),
[ArrayHashMap](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/ArrayHashMap.html),
[ClassUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/ClassUtil.html),
[EscapeUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/EscapeUtil.html),
[RegExUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/RegExUtil.html),
[FilenameUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/FilenameUtil.html),
[AWSJSONUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/AWSJSONUtil.html),
[AddrUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/AddrUtil.html),
[WSSecurityUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/WSSecurityUtil.html),
[EmailUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/EmailUtil.html),
[IEEE754rUtil](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/IEEE754rUtil.html),
[Timed](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/Timed.html),
[Index](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/Index.html),
[Median](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/Median.html),
[f](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/f.html),
[Matth](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/Matth.html),
[SafeInitializer](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/SafeInitializer.html),
[Stopwatch](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/Stopwatch.html),
[RateLimiter](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/RateLimiter.html),
[Traverser](https://static.javadoc.io/com.landawn/abacus-util/1.7.7/com/landawn/abacus/util/Traverser.html)(from Apache commons, Google Guava...) ...


## Download/Installation & [Changes](https://github.com/landawn/AbacusUtil/blob/master/CHANGES.md):
Expand All @@ -219,22 +219,22 @@ A general programming library in Java/Android. It's easy to learn and simple to
* Gradle:
```gradle
// JDK 1.8 or above:
compile 'com.landawn:abacus-util:1.7.6'
compile 'com.landawn:abacus-util:1.7.7'
// JDK 1.7:
compile 'com.landawn:abacus-util-jdk7:1.7.6'
compile 'com.landawn:abacus-util-jdk7:1.7.7'
// Android (Java 1.7):
compile 'abacus-android-jdk7:1.7.6'
compile 'abacus-android-jdk7:1.7.7'
// Android-SE (Java 1.7) - small edition without Stream/Matrix/Sheet/...:
compile 'abacus-android-se-jdk7:1.7.6'
compile 'abacus-android-se-jdk7:1.7.7'
// Android (Java 1.8 or above):
compile 'com.landawn:abacus-android:1.7.6'
compile 'com.landawn:abacus-android:1.7.7'
// Android-SE (Java 1.8 or above) - small edition without Stream/Matrix/Sheet/...:
compile 'com.landawn:abacus-android-se:1.7.6'
compile 'com.landawn:abacus-android-se:1.7.7'
```
### Functional Programming:
(It's very important to learn Lambdas and Stream APIs in Java 8 to get the best user experiences with the APIs provided in AbacusUtil)
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions src/com/landawn/abacus/DataSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -2898,16 +2898,16 @@ DataSet fullJoin(DataSet right, Map<String, String> onColumnNames, String newCol
/**
* Returns consecutive sub lists of this DataSet, each of the same chunkSize (the list may be smaller), or an empty List if this DataSet is empty.
*
* @param chunkSize
* @param chunkSize the desired size of each sub DataSet (the last may be smaller).
* @return
*/
Stream<DataSet> split(int chunkSize);

/**
* Returns consecutive sub lists of this DataSet, each of the same chunkSize (the list may be smaller), or an empty List if this DataSet is empty.
*
* @param chunkSize
* @param columnNames
* @param chunkSize the desired size of each sub DataSet (the last may be smaller).
* @return
*/
Stream<DataSet> split(Collection<String> columnNames, int chunkSize);
Expand Down
28 changes: 14 additions & 14 deletions src/com/landawn/abacus/android/util/SQLiteExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public SQLiteExecutor(final SQLiteDatabase sqliteDatabase, final NamingPolicy co
* @param readOnlyPropNames
*/
public static void registerReadOnlyProps(Class<?> targetClass, Collection<String> readOnlyPropNames) {
N.checkArgument(N.isEntity(targetClass), ClassUtil.getCanonicalClassName(targetClass) + " is not an entity class with getter/setter methods");
N.checkArgument(ClassUtil.isEntity(targetClass), ClassUtil.getCanonicalClassName(targetClass) + " is not an entity class with getter/setter methods");
N.checkArgNotNullOrEmpty(readOnlyPropNames, "'readOnlyPropNames'");

final Set<String> set = new HashSet<String>();
Expand All @@ -149,7 +149,7 @@ public static void registerReadOnlyProps(Class<?> targetClass, Collection<String
* @param writeOnlyPropNames
*/
public static void registerWriteOnlyProps(Class<?> targetClass, Collection<String> writeOnlyPropNames) {
N.checkArgument(N.isEntity(targetClass), ClassUtil.getCanonicalClassName(targetClass) + " is not an entity class with getter/setter methods");
N.checkArgument(ClassUtil.isEntity(targetClass), ClassUtil.getCanonicalClassName(targetClass) + " is not an entity class with getter/setter methods");
N.checkArgNotNullOrEmpty(writeOnlyPropNames, "'writeOnlyPropNames'");

final Set<String> set = new HashSet<String>();
Expand Down Expand Up @@ -280,7 +280,7 @@ static <T> List<T> toList(Class<T> targetClass, Cursor cursor) {
* @return
*/
static <T> List<T> toList(Class<T> targetClass, Cursor cursor, int offset, int count) {
if (N.isEntity(targetClass)) {
if (ClassUtil.isEntity(targetClass)) {
final DataSet ds = extractData(targetClass, cursor, offset, count);

if (ds == null || ds.isEmpty()) {
Expand Down Expand Up @@ -326,7 +326,7 @@ static <T> List<T> toList(final Class<T> targetClass, final Cursor cursor, final

final List<T> resultList = new ArrayList<>();

if (N.isEntity(targetClass)) {
if (ClassUtil.isEntity(targetClass)) {
final Method propSetMethod = ClassUtil.getPropSetMethod(targetClass, cursor.getColumnName(columnIndex));
final Type<T> selectColumnType = Type.valueOf(propSetMethod.getParameterTypes()[0]);

Expand Down Expand Up @@ -383,7 +383,7 @@ static <T> T toEntity(final Class<T> targetClass, final ContentValues contentVal
*/
@SuppressWarnings("deprecation")
static <T> T toEntity(final Class<T> targetClass, final ContentValues contentValues, NamingPolicy namingPolicy) {
if (!(N.isEntity(targetClass) || targetClass.equals(Map.class))) {
if (!(ClassUtil.isEntity(targetClass) || targetClass.equals(Map.class))) {
throw new IllegalArgumentException("The target class must be an entity class with getter/setter methods or Map.class. But it is: "
+ ClassUtil.getCanonicalClassName(targetClass));
}
Expand Down Expand Up @@ -461,7 +461,7 @@ static <T> T toEntity(final Class<T> targetClass, final ContentValues contentVal

if (propValue != null && !parameterType.isAssignableFrom(propValue.getClass())) {
if (propValue instanceof ContentValues) {
if (Map.class.isAssignableFrom(parameterType) || N.isEntity(parameterType)) {
if (Map.class.isAssignableFrom(parameterType) || ClassUtil.isEntity(parameterType)) {
ClassUtil.setPropValue(entity, propSetMethod, toEntity(parameterType, (ContentValues) propValue, namingPolicy));
} else {
ClassUtil.setPropValue(entity, propSetMethod,
Expand Down Expand Up @@ -617,7 +617,7 @@ private static ContentValues toContentValues(final Object obj, final Collection<
throw new IllegalArgumentException("Unsupported NamingPolicy: " + namingPolicy);
}

} else if (N.isEntity(obj.getClass())) {
} else if (ClassUtil.isEntity(obj.getClass())) {
if (obj instanceof DirtyMarker) {
final Class<?> srCls = obj.getClass();
final Set<String> updatePropNames = isForUpdate ? ((DirtyMarker) obj).dirtyPropNames() : ((DirtyMarker) obj).signedPropNames();
Expand Down Expand Up @@ -792,7 +792,7 @@ private static ContentValues toContentValues(final Object obj, final Collection<
* @see com.landawn.abacus.util.Maps#entity2Map(Object, boolean, Collection, NamingPolicy)
*/
public long insert(Object entity) {
if (!N.isEntity(entity.getClass())) {
if (!ClassUtil.isEntity(entity.getClass())) {
throw new IllegalArgumentException("The specified parameter must be an entity with getter/setter methods");
}

Expand All @@ -812,7 +812,7 @@ public long insert(Object entity) {
* @see com.landawn.abacus.util.Maps#entity2Map(Object, boolean, Collection, NamingPolicy)
*/
public long insert(Object entity, int conflictAlgorithm) {
if (!N.isEntity(entity.getClass())) {
if (!ClassUtil.isEntity(entity.getClass())) {
throw new IllegalArgumentException("The specified parameter must be an entity with getter/setter methods");
}

Expand Down Expand Up @@ -1027,7 +1027,7 @@ public <T> List<Long> insertAll(String table, Collection<T> records, boolean wit
* @return
*/
public int update(Object entity) {
if (!N.isEntity(entity.getClass())) {
if (!ClassUtil.isEntity(entity.getClass())) {
throw new IllegalArgumentException("The specified parameter must be an entity with getter/setter methods");
}

Expand All @@ -1054,7 +1054,7 @@ public int update(Object entity) {
* @see com.landawn.abacus.util.Maps#entity2Map(Object, boolean, Collection, NamingPolicy)
*/
public int update(Object entity, Condition whereClause) {
if (!N.isEntity(entity.getClass())) {
if (!ClassUtil.isEntity(entity.getClass())) {
throw new IllegalArgumentException("The specified parameter must be an entity with getter/setter methods");
}

Expand Down Expand Up @@ -1108,7 +1108,7 @@ public int update(String table, Object record, Condition whereClause) {
* @return
*/
public int delete(Object entity) {
if (!N.isEntity(entity.getClass())) {
if (!ClassUtil.isEntity(entity.getClass())) {
throw new IllegalArgumentException("The specified parameter must be an entity with getter/setter methods");
}

Expand Down Expand Up @@ -2119,7 +2119,7 @@ private Object[] prepareArguments(final NamedSQL namedSQL, final Object... param
final List<String> namedParameters = namedSQL.getNamedParameters();
Object[] result = parameters;

if (N.notNullOrEmpty(namedParameters) && parameters.length == 1 && (parameters[0] instanceof Map || N.isEntity(parameters[0].getClass()))) {
if (N.notNullOrEmpty(namedParameters) && parameters.length == 1 && (parameters[0] instanceof Map || ClassUtil.isEntity(parameters[0].getClass()))) {
result = new Object[parameterCount];
Object parameter_0 = parameters[0];

Expand Down Expand Up @@ -2273,7 +2273,7 @@ private Command interpretExpression(Expression exp) {
}

private static boolean isDirtyMarkerEntity(final Class<?> cls) {
return DirtyMarker.class.isAssignableFrom(cls) && N.isEntity(cls);
return DirtyMarker.class.isAssignableFrom(cls) && ClassUtil.isEntity(cls);
}

private static class Command {
Expand Down
8 changes: 4 additions & 4 deletions src/com/landawn/abacus/core/RowDataSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -2136,7 +2136,7 @@ public <K, V, M extends Map<K, V>> M toMap(Class<? extends V> rowClass, String k
}
} else if (valueType.isEntity()) {
final boolean ignoreUnknownProperty = valueColumnNames == _columnNameList;
final boolean isDirtyMarker = N.isDirtyMarker(rowClass);
final boolean isDirtyMarker = ClassUtil.isDirtyMarker(rowClass);
Object value = null;
String propName = null;

Expand Down Expand Up @@ -2231,7 +2231,7 @@ public <K, V, M extends Map<K, V>> M toMap(IntFunction<? extends V> rowSupplier,
}
} else if (valueType.isEntity()) {
final boolean ignoreUnknownProperty = valueColumnNames == _columnNameList;
final boolean isDirtyMarker = N.isDirtyMarker(rowClass);
final boolean isDirtyMarker = ClassUtil.isDirtyMarker(rowClass);
Object value = null;
String propName = null;

Expand Down Expand Up @@ -2369,7 +2369,7 @@ public <K, E, V extends Collection<E>, M extends Multimap<K, E, V>> M toMultimap
}
} else if (elementType.isEntity()) {
final boolean ignoreUnknownProperty = valueColumnNames == _columnNameList;
final boolean isDirtyMarker = N.isDirtyMarker(rowClass);
final boolean isDirtyMarker = ClassUtil.isDirtyMarker(rowClass);
Object value = null;
String propName = null;

Expand Down Expand Up @@ -2465,7 +2465,7 @@ public <K, E, V extends Collection<E>, M extends Multimap<K, E, V>> M toMultimap
}
} else if (elementType.isEntity()) {
final boolean ignoreUnknownProperty = valueColumnNames == _columnNameList;
final boolean isDirtyMarker = N.isDirtyMarker(rowClass);
final boolean isDirtyMarker = ClassUtil.isDirtyMarker(rowClass);
Object value = null;
String propName = null;

Expand Down
2 changes: 1 addition & 1 deletion src/com/landawn/abacus/http/HttpProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ private HttpClient getHttpClient(final Method method, final Object parameter, fi
Object newParameter = parameter;

if (type.isEntity()) {
newParameter = Maps.entity2Map(parameter, !N.isDirtyMarker(parameter.getClass()), null, _config.requestParamNamingPolicy);
newParameter = Maps.entity2Map(parameter, !ClassUtil.isDirtyMarker(parameter.getClass()), null, _config.requestParamNamingPolicy);
} else if (type.isMap()) {
final Map<String, Object> m = ((Map<String, Object>) parameter);
final Map<String, Object> newMap = new LinkedHashMap<>();
Expand Down
2 changes: 1 addition & 1 deletion src/com/landawn/abacus/http/WebServiceServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public void init(final ServletConfig config) throws ServletException {

parameterMethodMap.put(ClassUtil.getSimpleClassName(parameterClass), method);

if (N.isEntity(parameterClass)) {
if (ClassUtil.isEntity(parameterClass)) {
Object tempInstance = N.newInstance(parameterClass);
String st = xmlParser.serialize(tempInstance);
int index = st.indexOf('>');
Expand Down
2 changes: 1 addition & 1 deletion src/com/landawn/abacus/http/okhttp/OkHttpRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public OkHttpRequest body(final Object formBodyByEntity) {
}

final Class<?> cls = formBodyByEntity.getClass();
N.checkArgument(N.isEntity(cls), "{} is not an entity class with getter/setter methods", cls);
N.checkArgument(ClassUtil.isEntity(cls), "{} is not an entity class with getter/setter methods", cls);

final FormBody.Builder builder = new FormBody.Builder();

Expand Down
Loading

0 comments on commit 1ff7e6e

Please sign in to comment.