Index

A B C D F G I K M N O P R S T U V 
All Classes and Interfaces|All Packages|Serialized Form

A

AutoClose - Interface in io.github.jonloucks.contracts.api
Opt-in interface to For example, this is when threads should be stopped or hooks removed.
AutoOpen - Interface in io.github.jonloucks.contracts.api
Opt-in interface to be called once after creation, although implementations should handle this gracefully.

B

bind(Contract<T>, Promisor<T>) - Method in interface io.github.jonloucks.contracts.api.Contracts
Establish a binding between a Contract and a Promisor
bindContract(Contract<T>, Promisor<T>) - Static method in class io.github.jonloucks.contracts.api.GlobalContracts
Establish a binding between a Contract and a Promisor
builderCheck(T) - Static method in class io.github.jonloucks.contracts.api.Checks
Check if given builder is not null or invalid
builderConsumerCheck(T) - Static method in class io.github.jonloucks.contracts.api.Checks
Check if given builder consumer is not null or invalid

C

cast(Object) - Method in class io.github.jonloucks.contracts.api.Contract
Casts the given object to the return type for this Contract This is used to make sure the value is a checked value and does not sneak passed during erasure
cast(Object) - Method in interface io.github.jonloucks.contracts.api.Contract.Config
Ensure an instance is of type T (or descendant)
check() - Method in interface io.github.jonloucks.contracts.api.Repository
Check that all requirements have fulfilled
Checks - Class in io.github.jonloucks.contracts.api
Checks used internally and supported for external use.
claim(Contract<T>) - Method in interface io.github.jonloucks.contracts.api.Contracts
Claim the deliverable from a bound contract.
claimContract(Contract<T>) - Static method in class io.github.jonloucks.contracts.api.GlobalContracts
Claim the deliverable from a bound contract.
close() - Method in interface io.github.jonloucks.contracts.api.AutoClose
AutoClose this instance.
configCheck(T) - Static method in class io.github.jonloucks.contracts.api.Checks
Check if given config is not null or invalid
Contract<T> - Class in io.github.jonloucks.contracts.api
The API agreement for a Contract between the claimee and the claimant.
CONTRACT - Static variable in interface io.github.jonloucks.contracts.api.Promisors
The contract for this interface.
Contract.Config<T> - Interface in io.github.jonloucks.contracts.api
The configuration for creating a custom Contract.
Contract.Config.Builder<T> - Interface in io.github.jonloucks.contracts.api
Partial builder to streamline custom contracts
contractCheck(Contract<T>) - Static method in class io.github.jonloucks.contracts.api.Checks
Check if given Contract is not null or invalid
ContractException - Exception in io.github.jonloucks.contracts.api
Runtime exception thrown for Contract related problems.
ContractException(String) - Constructor for exception io.github.jonloucks.contracts.api.ContractException
Passthrough for RuntimeException(String)
ContractException(String, Throwable) - Constructor for exception io.github.jonloucks.contracts.api.ContractException
Contracts - Interface in io.github.jonloucks.contracts.api
The actual implementation used for Contracts itself.
Contracts.Config - Interface in io.github.jonloucks.contracts.api
The Contracts configuration
contractsCheck(Contracts) - Static method in class io.github.jonloucks.contracts.api.Checks
Check if given Contracts is not null or invalid
ContractsFactory - Interface in io.github.jonloucks.contracts.api
A Contracts factory to bootstrapping GlobalContracts and provide Standalone services for special needs.
create(Contract.Config<T>) - Static method in class io.github.jonloucks.contracts.api.Contract
Create a contract derived from the given configuration
create(Contracts.Config) - Method in interface io.github.jonloucks.contracts.api.ContractsFactory
Create a new Contracts Note: Caller is responsible for invoking 'startup' before using methods Note: If caller does invoke 'open' it is required to invoke 'close' when appropriate
create(Class<T>) - Static method in class io.github.jonloucks.contracts.api.Contract
Create a contract with a given name, the rest is automatic.
create(Class<T>, Consumer<Contract.Config.Builder<T>>) - Static method in class io.github.jonloucks.contracts.api.Contract
Create a contract from a class type and an optional builder callback
create(String, T...) - Static method in class io.github.jonloucks.contracts.api.Contract
Create a contract with a given name, the rest is automatic.
createContracts(Contracts.Config) - Static method in class io.github.jonloucks.contracts.api.GlobalContracts
Create a standalone Contracts service.
createExtractPromisor(Promisor<T>, Function<T, R>) - Method in interface io.github.jonloucks.contracts.api.Promisors
Extract Note: increment and decrementUsage are relayed to the source promisor.
createLifeCyclePromisor(Promisor<T>) - Method in interface io.github.jonloucks.contracts.api.Promisors
Reference counted, lazy loaded, with opt-in 'open' and 'close' invoked on deliverable.
createSingletonPromisor(Promisor<T>) - Method in interface io.github.jonloucks.contracts.api.Promisors
Creates a Promisor that only calls the source Promisor once and then always returns that value.
createValuePromisor(T) - Method in interface io.github.jonloucks.contracts.api.Promisors
Creates a Promisor that returns the given value every type it is claimed.

D

decrementUsage() - Method in interface io.github.jonloucks.contracts.api.Promisor
Reference counting used for advanced resource management Incremented by GlobalContracts.bindContract(Contract, Promisor) Decremented if caller invokes AutoClose.close() on the return value of bind Every successful 'open' must be followed by a 'close' at the appropriate time
demand() - Method in interface io.github.jonloucks.contracts.api.Promisor
Return the deliverable promised for a Contract

F

FACTORY - Static variable in interface io.github.jonloucks.contracts.api.Repository
Contract to deliver a Repository factory

G

getInstance() - Static method in class io.github.jonloucks.contracts.api.GlobalContracts
Return the global instance of Contracts
getName() - Method in class io.github.jonloucks.contracts.api.Contract
 
getTypeName() - Method in class io.github.jonloucks.contracts.api.Contract
Note: Do not rely on this being a java class name Note: The actual class is never exposed and is by design.
GlobalContracts - Class in io.github.jonloucks.contracts.api
Provides access to the shared singleton of a Contracts implementation

I

illegalCheck(T, boolean, String) - Static method in class io.github.jonloucks.contracts.api.Checks
Check if given instance is not null
incrementUsage() - Method in interface io.github.jonloucks.contracts.api.Promisor
Reference counting used for advanced resource management Incremented by GlobalContracts.bindContract(Contract, Promisor) Decremented if caller invokes AutoClose.close() on the return value of bind Every successful 'open' must be followed by a 'close' at the appropriate time
io.github.jonloucks.contracts.api - module io.github.jonloucks.contracts.api
The API module for Contracts
io.github.jonloucks.contracts.api - package io.github.jonloucks.contracts.api
 
isBound(Contract<T>) - Method in interface io.github.jonloucks.contracts.api.Contracts
Checks if the contract is bound to a Promisor
isContractBound(Contract<T>) - Static method in class io.github.jonloucks.contracts.api.GlobalContracts
Checks if the contract is bound to a Promisor
isReplaceable() - Method in interface io.github.jonloucks.contracts.api.Contract.Config
When replaceable a new binding can replace in an existing one The default is false
isReplaceable() - Method in class io.github.jonloucks.contracts.api.Contract
When replaceable a new binding can replace in an existing one The default is false

K

keep(Contract<T>, Promisor<T>) - Method in interface io.github.jonloucks.contracts.api.Repository
Keep the binding for the life of the repository If the Repository is not open, the binding will be created when repository is opened.

M

messageCheck(T) - Static method in class io.github.jonloucks.contracts.api.Checks
Check if given message is not null or invalid

N

name() - Method in interface io.github.jonloucks.contracts.api.Contract.Config
User defined name for this contract.
name(String) - Method in interface io.github.jonloucks.contracts.api.Contract.Config.Builder
Set the Contract name
nameCheck(T) - Static method in class io.github.jonloucks.contracts.api.Checks
Check if given name is not null or invalid
nullCheck(T, String) - Static method in class io.github.jonloucks.contracts.api.Checks
Check if given instance is not null

O

open() - Method in interface io.github.jonloucks.contracts.api.AutoOpen
AutoOpen this instance

P

Promisor<T> - Interface in io.github.jonloucks.contracts.api
Interface for providing a deliverable for a Contract The main and required implementation is Promisor.demand() There are optional methods with appropriate defaults.
promisorCheck(Promisor<T>) - Static method in class io.github.jonloucks.contracts.api.Checks
Check if given Promisor is not null or invalid
Promisors - Interface in io.github.jonloucks.contracts.api
Helper methods for creating and chaining Promisors used for GlobalContracts.bindContract(Contract, Promisor)

R

reflectionClassName() - Method in interface io.github.jonloucks.contracts.api.Contracts.Config
 
replaceable(boolean) - Method in interface io.github.jonloucks.contracts.api.Contract.Config.Builder
Set if the Contract binding can be replaced
Repository - Interface in io.github.jonloucks.contracts.api
A repository for multiple contract promisors This is an opt-in feature to simplify the managing of many contract bindings.
require(Contract<T>) - Method in interface io.github.jonloucks.contracts.api.Repository
Added a required contract

S

serviceLoaderClass() - Method in interface io.github.jonloucks.contracts.api.Contracts.Config
 
store(Contract<T>, Promisor<T>) - Method in interface io.github.jonloucks.contracts.api.Repository
Store the binding.

T

toString() - Method in class io.github.jonloucks.contracts.api.Contract
 
typeCheck(T) - Static method in class io.github.jonloucks.contracts.api.Checks
Check if given type is not null or invalid
typeName() - Method in interface io.github.jonloucks.contracts.api.Contract.Config
The type of deliverable for this contract.
typeName(String) - Method in interface io.github.jonloucks.contracts.api.Contract.Config.Builder
Set the Contract typeName

U

useReflection() - Method in interface io.github.jonloucks.contracts.api.Contracts.Config
 
useServiceLoader() - Method in interface io.github.jonloucks.contracts.api.Contracts.Config
 
useShutdownHooks() - Method in interface io.github.jonloucks.contracts.api.Contracts.Config
 

V

validateContracts(Contracts) - Static method in class io.github.jonloucks.contracts.api.Checks
A simple runtime validation of deployed implementation
A B C D F G I K M N O P R S T U V 
All Classes and Interfaces|All Packages|Serialized Form