Skip to content

Commit b51fd9b

Browse files
committed
More javadocs for TypeSafeKey
1 parent 22b8789 commit b51fd9b

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎src/main/java/com/jnape/palatable/lambda/adt/hmap/TypeSafeKey.java‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@
77
import com.jnape.palatable.lambda.lens.LensLike;
88

99
/**
10-
* An interface representing a parametrized key for use in {@link HMap}s. The parameter specifies the type of the value
11-
* stored at this binding inside the {@link HMap}.
10+
* An interface representing a parametrized key for use in {@link HMap}s. Additionally, every {@link TypeSafeKey} is an
11+
* {@link Iso} from the type the value is stored as to the type it's viewed and set as (on the way in / on the way out).
12+
* This allows multiple keys to map to the same value, but to view the value as different types.
1213
* <p>
1314
* This is intentionally an interface so user-defined implementations are possible; however, it's important to note
1415
* that all hopes of type-safety hinge on equality being implemented such that no two {@link TypeSafeKey}s with
1516
* differing value-type parameters may be considered equal. Reference equality is used here as the default, as that is
1617
* sufficient.
1718
*
18-
* @param <A> The type of the value that this key maps to inside an {@link HMap}
19+
* @param <A> The raw type of the value that this key maps to inside an {@link HMap}
20+
* @param <B> The mapped type of the value that this key maps to inside an {@link HMap}
1921
*/
2022
public interface TypeSafeKey<A, B> extends Iso.Simple<A, B> {
2123

0 commit comments

Comments
 (0)