AveyTense Java

AveyTense will be also written in Java! Currently, it is projected, and it will be for Java 8 and later. For Python equivalent see /aveytense

The project isn't a malware. If you have doubts, you can verify the source code of the recent release of the project. Project inquiries: aveyzan@gmail.com

Versioning

Every AveyTense Java version has questionable versioning to follow, but will be linked here once decided.

Supported Python versions

AveyTense written on Java will support Java 8 and later. For July 2026, it would support the following versions: 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, what means all LTS releases (8, 11, 17, 21, 25) will be supported.

Unlike Python version of AveyTense (sys.version_info), Java version of the project will not have any code alteration, since there is no such definition that allows invoking specific lines of the code.

Definitions

Projected definitions that will likely show up once the project will be published.

class aveytense.Tense


≥ 0.0.1

Defined as a final public class, and will be standard.
static <T> aveytense.Tense.arrayListOf()
static <T> aveytense.Tense.arrayListOf(T... e)

ArrayList<T>


≥ 0.0.1

Both overloads return an ArrayList object, respectively, empty and filled with an arbitrary amount of elements.

Inspired by List.of() static method that was defined in Java 9.

static <T> aveytense.Tense.flatten(Collection<Collection<T>> collection)
ArrayList<T>


≥ 0.0.1

Transforms a duo-dimensional Collection object into an one-dimensional ArrayList object.

This is Python reference with the same name (aveytense.Tense.flatten()).

static <T> aveytense.Tense.isIn(T target, Collection<T> collection)
static <T> aveytense.Tense.isIn(T target, Stream<T> stream)
static aveytense.Tense.isIn(char target, String string)

→ boolean


≥ 0.0.1

Returns true when a target is found in the collection or stream, or when a character is found in a string.

This is Python reference with the same name (aveytense.Tense.isIn()).

static <T> aveytense.Tense.pick(Iterable<T> iterable)
static <T> aveytense.Tense.pick(Iterator<T> iterator)
static <T> aveytense.Tense.pick(Collection<T> collection)
static <T> aveytense.Tense.pick(Stream<T> stream)
static <T> aveytense.Tense.pick(T[] array)
static aveytense.Tense.pick(String string) → char

→ T


≥ 0.0.1

Returns a random item from the target object. For strings a random character is returned.

This is Python reference with the same name (aveytense.Tense.pick()).

static final aveytense.Tense.random → Random
static aveytense.Tense.random(long|int|short|byte x[, long|int|short|byte y]) → long|int|short|byte
static aveytense.Tense.random(String string[, int length]) → String


≥ 0.0.1

Occurs simultaneously as a static final field and static method. When used as a field, it holds an object of type Random. This field transforms into a method once adding circular brackets.

When the method gets one argument, it returns a random integer (integer type is dependent to the passed argument; e.g. for int, int is returned) in range ⟨0; x❩, or a string with randomized characters from the input string, with fixed length of 10.

When the method gets two arguments, it returns a random integer in range ⟨x; y⟩ (or ⟨y; x⟩ when x > y), or a string with randomized characters from the input string, with length given in the second argument. This string will be empty when the input string is empty or value of the length argument is least than or equal to 0.

All integer types (long, int, short, byte) are supported; only exception is at the length parameter that only accepts the type int.

There is a table of all possible invocations with two arguments as integers:

x type y type Returned type
long long long
int
short
byte
int long
short
byte
int int int
short
byte
short int
byte
short short short
byte
byte short
byte byte byte

This is Python reference with the same name (aveytense.Tense.random()).

static <T> aveytense.Tense.toArrayList(Iterable<T> iterable)
static <T> aveytense.Tense.toArrayList(Iterator<T> iterator)
static <T> aveytense.Tense.toArrayList(Collection<T> collection)
static <T> aveytense.Tense.toArrayList(Stream<T> stream)
static <T> aveytense.Tense.toArrayList(T[] array)
static <T = Character> aveytense.Tense.toArrayList(Character[] array)
static <T = Character> aveytense.Tense.toArrayList(String string)

ArrayList<T>


≥ 0.0.1

Returns a passed argument as an ArrayList object.
static aveytense.Tense.toString(Iterable<Character> iterable)
static aveytense.Tense.toString(Iterator<Character> iterator)
static aveytense.Tense.toString(Collection<Character> collection)
static aveytense.Tense.toString(Stream<Character> stream)
static aveytense.Tense.toString(Character[] array)
static aveytense.Tense.toString(char[] array)
static aveytense.Tense.toString(char c)

String


≥ 0.0.1

Returns a passed argument as a string. Note normally such method would be overriden from Object, in this case it is defined static.

It also serves as an alternative constructor for String.

If you get to meet with Character[], it is invalid for the constructor of String (no such overload that would support Character[]). While there is the closest signature String(char[]), casting from Character[] to char[] to satisfy the type requirement, is incorrect. While char[].class.cast() also fails, the aveytense.Tense.unwrap() static method fixes it.
static aveytense.Tense.unwrap(Character[] c) -> char[]
static aveytense.Tense.unwrap(Character[][] c) -> char[][]
static aveytense.Tense.unwrap(Character[][][] c) -> char[][][]
static aveytense.Tense.unwrap(Byte[] b) -> byte[]
static aveytense.Tense.unwrap(Byte[][] b) -> byte[][]
static aveytense.Tense.unwrap(Byte[][][] b) -> byte[][][]
static aveytense.Tense.unwrap(Short[] s) -> short[]
static aveytense.Tense.unwrap(Short[][] s) -> short[][]
static aveytense.Tense.unwrap(Short[][][] s) -> short[][][]
static aveytense.Tense.unwrap(Integer[] i) -> int[]
static aveytense.Tense.unwrap(Integer[][] i) -> int[][]
static aveytense.Tense.unwrap(Integer[][][] i) -> int[][][]
static aveytense.Tense.unwrap(Long[] l) -> long[]
static aveytense.Tense.unwrap(Long[][] l) -> long[][]
static aveytense.Tense.unwrap(Long[][][] l) -> long[][][]
static aveytense.Tense.unwrap(Boolean[] b) -> boolean[]
static aveytense.Tense.unwrap(Boolean[][] b) -> boolean[][]
static aveytense.Tense.unwrap(Boolean[][][] b) -> boolean[][][]


≥ 0.0.1

Returns an array as primitively-typed array. Up to 3 dimensions are allowed in the given array, and all of these overloads work the same way.

This is an inversion of aveytense.Tense.wrap()

Direct inspiration for making this static method is array type casting experiment (cannot cast from a wrapped type to a primitive type and vice versa). The Class.cast() method, which was also considered during testing, also fails, throwing ClassCastException.

static aveytense.Tense.wrap(char[] c) -> Character[]
static aveytense.Tense.wrap(char[][] c) -> Character[][]
static aveytense.Tense.wrap(char[][][] c) -> Character[][][]
static aveytense.Tense.wrap(byte[] b) -> Byte[]
static aveytense.Tense.wrap(byte[][] b) -> Byte[][]
static aveytense.Tense.wrap(byte[][][] b) -> Byte[][][]
static aveytense.Tense.wrap(short[] s) -> Short[]
static aveytense.Tense.wrap(short[][] s) -> Short[][]
static aveytense.Tense.wrap(short[][][] s) -> Short[][][]
static aveytense.Tense.wrap(int[] i) -> Integer[]
static aveytense.Tense.wrap(int[][] i) -> Integer[][]
static aveytense.Tense.wrap(int[][][] i) -> Integer[][][]
static aveytense.Tense.wrap(long[] l) -> Long[]
static aveytense.Tense.wrap(long[][] l) -> Long[][]
static aveytense.Tense.wrap(long[][][] l) -> Long[][][]


≥ 0.0.1

Returns an array of the wrapped type. Up to 3 dimensions are allowed in the given array, and all of these overloads work the same way.

This is an inversion of aveytense.Tense.unwrap()

This static method was defined after aveytense.Tense.unwrap() to allow falling back to the base array type.