Interface GeneratedResource.Content
- All Superinterfaces:
InputStreamSource
- Enclosing class:
GeneratedResource
Abstraction of the content of a generated resource.
- Since:
- 7.1
- Author:
- Stephane Nicoll
-
Method Summary
Modifier and TypeMethodDescriptionvoidcreate(CharSequence content) Create this instance with the content from the givenCharSequence.voidcreate(InputStreamSource content) Create this instance with the content from the givenInputStreamSource.voidcreate(ThrowingConsumer<Appendable> content) Create this instance with the content written to anAppendablepassed to the givenThrowingConsumer.voidcreateOrValidate(CharSequence content) Create this instance with the content from the givenCharSequenceif it does not exist or validate that the existing content matches.voidcreateOrValidate(InputStreamSource content) Create this instance with the content from the givenInputStreamSourceif it does not exist or validate that the existing content matches.voidcreateOrValidate(ThrowingConsumer<Appendable> content) Create this instance with the content written to anAppendablepassed to the givenThrowingConsumerif it does not exist or validate that the existing content matches.booleanexists()Specify if this content exists.Methods inherited from interface InputStreamSource
getInputStream
-
Method Details
-
exists
boolean exists()Specify if this content exists. Use this as a check before callingInputStreamSource.getInputStream().- Returns:
trueif this instance has been created
-
create
Create this instance with the content from the givenCharSequence.- Parameters:
content- the content- Throws:
IllegalStateException- if this instance has already been created
-
createOrValidate
Create this instance with the content from the givenCharSequenceif it does not exist or validate that the existing content matches.- Parameters:
content- the content- Throws:
IllegalArgumentException- if this instance has already been created, but its content does not match the givencontent
-
create
Create this instance with the content written to anAppendablepassed to the givenThrowingConsumer.- Parameters:
content- aThrowingConsumerthat accepts anAppendablewhich will receive the content- Throws:
IllegalStateException- if this instance has already been created
-
createOrValidate
Create this instance with the content written to anAppendablepassed to the givenThrowingConsumerif it does not exist or validate that the existing content matches.- Parameters:
content- aThrowingConsumerthat accepts anAppendablewhich will receive the content- Throws:
IllegalArgumentException- if this instance has already been created, but its content does not match the givencontent
-
create
Create this instance with the content from the givenInputStreamSource.- Parameters:
content- anInputStreamSourcethat will provide an input stream containing the content- Throws:
IllegalStateException- if this instance has already been created
-
createOrValidate
Create this instance with the content from the givenInputStreamSourceif it does not exist or validate that the existing content matches.- Parameters:
content- anInputStreamSourcethat will provide an input stream containing the content- Throws:
IllegalArgumentException- if this instance has already been created, but its content does not match the givencontent
-