public class ResourceFactory extends Object implements IResourceFactory
| Constructor and Description |
|---|
ResourceFactory(IClient client) |
| Modifier and Type | Method and Description |
|---|---|
IResource |
create(InputStream input)
Create a resource from a response string
|
<T extends IResource> |
create(String response)
Create a resource from a response string
|
<T extends IResource> |
create(String version,
String kind)
Create(or stub) a resource for a given version and kind
|
<T extends IResource> |
create(String version,
String kind,
String name)
Create(or stub) a resource for a given version and kind and name
|
Object |
createInstanceFrom(String response)
Create a resource from a response string
|
List<IResource> |
createList(String json,
String kind)
Create a list of resources of the given kind from a response string
|
static Map<String,Class<? extends IResource>> |
getImplMap() |
void |
setClient(IClient client)
The client given to resources when they are created
|
<T extends IResource> |
stub(String kind,
String name)
Stub out the given resource kind using a version determined by the factory
|
<T extends IResource> |
stub(String kind,
String name,
String namespace)
Stub out the given resource kind using a version determined by the factory
|
Object |
stubKind(String kind,
Optional<String> name,
Optional<String> namespace)
Stub out the given resource kind using a version determined by the factory
|
public ResourceFactory(IClient client)
public List<IResource> createList(String json, String kind)
IResourceFactorycreateList in interface IResourceFactorypublic IResource create(InputStream input)
IResourceFactorycreate in interface IResourceFactoryinput - Read the given input stream which assumes the input is parsable
JSON representing a valid resourcepublic <T extends IResource> T create(String response)
IResourceFactorycreate in interface IResourceFactorypublic <T extends IResource> T create(String version, String kind)
IResourceFactorycreate in interface IResourceFactorypublic <T extends IResource> T create(String version, String kind, String name)
IResourceFactorycreate in interface IResourceFactorypublic Object createInstanceFrom(String response)
ITypeFactorycreateInstanceFrom in interface ITypeFactorypublic <T extends IResource> T stub(String kind, String name, String namespace)
IResourceFactorystub in interface IResourceFactorypublic <T extends IResource> T stub(String kind, String name)
IResourceFactorystub in interface IResourceFactorypublic Object stubKind(String kind, Optional<String> name, Optional<String> namespace)
ITypeFactorystubKind in interface ITypeFactorykind - - Required. For arg types it may be in the form of
apigroup/version.kindname - - The name of the kind which may only be significant for instances
that can be persisted by the server (e.g. Service)namespace - - The namespace of the kind which may only be significant for
instance that can be persistedpublic void setClient(IClient client)
IResourceFactorysetClient in interface IResourceFactoryCopyright © 2020 Red Hat, Inc. All Rights Reserved.