Class ResourceCqlScript
- java.lang.Object
-
- com.github.nosan.embedded.cassandra.cql.AbstractCqlScript
-
- com.github.nosan.embedded.cassandra.cql.ResourceCqlScript
-
- All Implemented Interfaces:
CqlScript
public class ResourceCqlScript extends AbstractCqlScript
An implementation ofCqlScriptthat reads CQL statements from aResource.Example Usage:
ResourceCqlScript script = new ResourceCqlScript(new ClassPathResource("schema.cql"), StandardCharsets.UTF_8); List<String> statements = script.getStatements(); statements.forEach(statement -> System.out.println(statement));- Since:
- 4.0.0
- Author:
- Dmytro Nosan
-
-
Constructor Summary
Constructors Constructor Description ResourceCqlScript(Resource resource)Creates a newResourceCqlScriptwith the givenResourceand the default platform charset.ResourceCqlScript(Resource resource, Charset charset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)inthashCode()StringtoString()-
Methods inherited from class com.github.nosan.embedded.cassandra.cql.AbstractCqlScript
getStatements
-
Methods inherited from interface com.github.nosan.embedded.cassandra.cql.CqlScript
forEachStatement
-
-
-
-
Constructor Detail
-
ResourceCqlScript
public ResourceCqlScript(Resource resource)
Creates a newResourceCqlScriptwith the givenResourceand the default platform charset.- Parameters:
resource- the resource containing CQL statements (must not benull)- Throws:
NullPointerException- ifresourceisnull
-
ResourceCqlScript
public ResourceCqlScript(Resource resource, Charset charset)
- Parameters:
resource- the resource containing CQL statements (must not benull)charset- the character encoding to use when reading the resource (must not benull)- Throws:
NullPointerException- ifresourceorcharsetisnull
-
-