Skip to content

Commit

Permalink
[Java] add missing jdk primitive function (#848)
Browse files Browse the repository at this point in the history
add missing jdk primitive function
  • Loading branch information
chaokunyang authored Aug 6, 2023
1 parent 74e41a0 commit d786715
Show file tree
Hide file tree
Showing 16 changed files with 101 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
import io.fury.serializer.CompatibleSerializer;
import io.fury.type.Descriptor;
import io.fury.type.TypeUtils;
import io.fury.util.Functions;
import io.fury.util.function.Functions;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import io.fury.serializer.ObjectSerializer;
import io.fury.type.Descriptor;
import io.fury.type.DescriptorGrouper;
import io.fury.util.Functions;
import io.fury.util.function.Functions;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import io.fury.collection.Tuple3;
import io.fury.type.Descriptor;
import io.fury.type.DescriptorGrouper;
import io.fury.util.Functions;
import io.fury.util.function.Functions;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@
import com.google.common.primitives.Primitives;
import com.google.common.reflect.TypeToken;
import io.fury.type.TypeUtils;
import io.fury.util.Functions;
import io.fury.util.Platform;
import io.fury.util.ReflectionUtils;
import io.fury.util.StringUtils;
import io.fury.util.function.Functions;
import java.lang.reflect.Array;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import com.google.common.base.Preconditions;
import io.fury.codegen.Expression.Reference;
import io.fury.util.Functions;
import io.fury.util.function.Functions;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
import com.google.common.reflect.TypeToken;
import io.fury.codegen.Expression.Cast;
import io.fury.codegen.Expression.Null;
import io.fury.util.Functions;
import io.fury.util.StringUtils;
import io.fury.util.function.Functions;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import com.google.common.base.Preconditions;
import io.fury.Language;
import io.fury.serializer.Serializer;
import io.fury.util.Functions;
import io.fury.util.ReflectionUtils;
import io.fury.util.function.Functions;

/**
* This class put together object type related information to reduce array/map loop up when
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@
import io.fury.type.Descriptor;
import io.fury.type.GenericType;
import io.fury.type.TypeUtils;
import io.fury.util.Functions;
import io.fury.util.LoggerFactory;
import io.fury.util.Platform;
import io.fury.util.ReflectionUtils;
import io.fury.util.StringUtils;
import io.fury.util.function.Functions;
import java.io.Externalizable;
import java.io.Serializable;
import java.lang.reflect.Field;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.google.common.base.Preconditions;
import com.google.common.reflect.TypeToken;
import io.fury.collection.Tuple3;
import io.fury.util.function.Functions;
import java.io.ObjectStreamClass;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
* limitations under the License.
*/

package io.fury.util;
package io.fury.util.function;

import com.google.common.base.Preconditions;
import io.fury.util.ReflectionUtils;
import java.io.Serializable;
import java.lang.invoke.SerializedLambda;
import java.lang.reflect.Method;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright 2023 The Fury Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.fury.util.function;

@FunctionalInterface
public interface ToByteFunction<T> {
byte applyAsByte(T value);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright 2023 The Fury Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.fury.util.function;

@FunctionalInterface
public interface ToCharFunction<T> {
char applyAsChar(T value);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright 2023 The Fury Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.fury.util.function;

@FunctionalInterface
public interface ToFloatFunction<T> {
float applyAsFloat(T value);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright 2023 The Fury Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.fury.util.function;

@FunctionalInterface
public interface ToShortFunction<T> {
short applyAsShort(T value);
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package io.fury.util;

import io.fury.util.function.Functions;
import java.util.ArrayList;
import java.util.Collections;
import java.util.function.Consumer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
import io.fury.format.row.binary.BinaryArray;
import io.fury.format.row.binary.BinaryUtils;
import io.fury.type.TypeUtils;
import io.fury.util.Functions;
import io.fury.util.StringUtils;
import io.fury.util.function.Functions;

/**
* Expression for iterate {@link io.fury.format.row.ArrayData} with specified not null element
Expand Down

0 comments on commit d786715

Please sign in to comment.