public final class WrappingHint extends Object
When collection field of class is initialized, it is common to use copy-and-wrap idiom to make the collection immutable.
For example:
this.list = Collections.unmodifiableList(new ArrayList
When mentioned idiom is not used correctly, or not used at all class
WrappingHint
will represent a hint to help user apply copy-and-wrap
idiom in a correct way.
Modifier and Type | Class and Description |
---|---|
static class |
WrappingHint.Builder |
Modifier and Type | Field and Description |
---|---|
static WrappingHint |
NO_HINT |
Modifier and Type | Method and Description |
---|---|
static WrappingHint.Builder |
builder() |
String |
getWrappingHint(String fieldName)
For given field name get the actual hint message
|
boolean |
isEmpty() |
public static final WrappingHint NO_HINT
public String getWrappingHint(String fieldName)
public boolean isEmpty()
public static WrappingHint.Builder builder()
Copyright © 2008–2020 Graham Allan. All rights reserved.