The meaning of interesting syntax

In our code base, I saw the following code fragment, and I could not understand what it was (therefore, I could not start searching for additional information). The code snippet is as follows:

TypedId.< UserGroupsVO > valueOf( 1000L )

For a more detailed definition, the definition of type TypedId is as follows:

public final class TypedId< T > implements Serializable, Comparable< TypedId< T >>

What topic can I learn more about this syntax and what does it mean?

EDIT

After the comments, I need to clarify my question. In my question, I did not mean Generics . The part, I did not understand, is the dot between TypedId with <...> and between <...> s valueOfthere is a space.

+4
source share
2 answers

Static method valueOf

public static <T> TypedId<T> valueOf(long aValue) ...
              ^^^

T. , TypedId.valueOf(...), , T.

TypedId.<UserGroupsVO>valueOf(...)
        ^^^^^^^^^^^^^^

TypedId.< UserGroupsVO >valueOf : .


, , TypedId . ; .

, .

class Foo {
     public static <T> List<T> makeList() ...
}
...
Foo.<String>makeList(); // call with a generic type parameter

.

class Bar<T> {
     public static void doThing() ...
}
...
Bar.doThing(); // call without a generic type parameter
+4

TypedId< T > - , T.

, , TypeId<T> valueOf, T. .

, . : <? extends E> - .

TypedId.< UserGroupsVO > valueOf( 1000L ), , T UserGroupsVO

JLS Ref:

+2

Source: https://habr.com/ru/post/1671246/


All Articles