com.github.dreamhead.moco.resource
Class Resource

java.lang.Object
  extended by com.github.dreamhead.moco.resource.Resource
All Implemented Interfaces:
ConfigApplier<Resource>, Identifiable, ResourceReader
Direct Known Subclasses:
ContentResource

public class Resource
extends java.lang.Object
implements Identifiable, ConfigApplier<Resource>, ResourceReader


Field Summary
protected  ResourceReader reader
           
 
Constructor Summary
Resource(Identifiable identifiable, ResourceConfigApplier configApplier, ResourceReader reader)
           
 
Method Summary
 Resource apply(MocoConfig config)
           
 java.lang.String id()
           
 byte[] readFor(io.netty.handler.codec.http.FullHttpRequest request)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reader

protected ResourceReader reader
Constructor Detail

Resource

public Resource(Identifiable identifiable,
                ResourceConfigApplier configApplier,
                ResourceReader reader)
Method Detail

apply

public Resource apply(MocoConfig config)
Specified by:
apply in interface ConfigApplier<Resource>

id

public java.lang.String id()
Specified by:
id in interface Identifiable

readFor

public byte[] readFor(io.netty.handler.codec.http.FullHttpRequest request)
Specified by:
readFor in interface ResourceReader