us.bpsm.edn.protocols
Interface Protocol<F>
-
public interface Protocol<F>A Protocol is a thread-safe immutable mapping from classes to values of some typeF. Each Protocol is created by aProtocol.Builder.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface and Description static interfaceProtocol.Builder<F>A single-use builder for Protocol.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description Flookup(java.lang.Class selfClass)Return theFassociated withselfClass.java.lang.Stringname()The name of this protocol.
-
-
-
Method Detail
-
name
java.lang.String name()
The name of this protocol. (This is intended to support debugging scenarios.)
-
lookup
F lookup(java.lang.Class selfClass)
Return theFassociated withselfClass.If the Protocol does not contain a mapping for exactly
selfClass, then tryselfClass's supertypes in C3 linearized order, only returningnullwhen all sueprtypes have been tried without finding a match.selfClassmay benull, in which case return theFassociated withnull.nullhas no supertypes, so if noFis associated withnull, returnnull.- Parameters:
selfClass- find an F for this class. May benull.- Returns:
- an F, or
null.
-
-
DMelt 3.0 © DataMelt by jWork.ORG