@Retention(value=RUNTIME) @Target(value=PARAMETER) public static @interface Messages.Offset
Messages.PluralCount, and provides an offset to be
subtracted from the value before a plural rule is chosen or the value is formatted. Note that
"=n" forms are evaluated before this offset is applied.
Example: would result in
@PluralText({"=0", "No one has recommended this movie",
"=1", "{0} has recommended this movie",
"=2", "{0} and {1} have recommended this movie",
"one", "{0}, {1} and one other have recommended this movie"})
@DefaultMessage("{0}, {1} and {2,number} others have recommended this movie")
String recommenders(@Optional String rec1, @Optional String rec2,
@PluralCount @Offset(2) int count);
recommenders("John", null, 1) => "John has..."
recommenders("John", "Jane", 3) => "John, Jane, and one other..."
recommenders("John", "Jane", 1402) => "John, Jane, and 1,400 others..."
| Modifier and Type | Required Element and Description |
|---|---|
int |
value |
Copyright © 2018–2020. All rights reserved.