Package eu.rekawek.toxiproxy.model
Class Toxic
- java.lang.Object
-
- eu.rekawek.toxiproxy.model.Toxic
-
-
Constructor Summary
Constructors Constructor Description Toxic(HttpClient httpClient, String path, com.google.gson.JsonObject json)Toxic(HttpClient httpClient, String toxicListPath, String name, ToxicDirection stream)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcreateToxic(String toxicListPath)protected abstract com.google.gson.JsonObjectgetAttributes()StringgetName()ToxicDirectiongetStream()floatgetToxicity()protected abstract ToxicTypegetType()protected voidpostAttribute(String name, long value)voidremove()protected abstract voidsetAttributes(com.google.gson.JsonObject attributes)voidsetToxicity(float toxicity)StringtoString()
-
-
-
Constructor Detail
-
Toxic
public Toxic(HttpClient httpClient, String toxicListPath, String name, ToxicDirection stream)
-
Toxic
public Toxic(HttpClient httpClient, String path, com.google.gson.JsonObject json)
-
-
Method Detail
-
setAttributes
protected abstract void setAttributes(com.google.gson.JsonObject attributes)
-
getAttributes
protected abstract com.google.gson.JsonObject getAttributes()
-
getType
protected abstract ToxicType getType()
-
createToxic
protected void createToxic(String toxicListPath) throws IOException
- Throws:
IOException
-
postAttribute
protected void postAttribute(String name, long value) throws IOException
- Throws:
IOException
-
setToxicity
public void setToxicity(float toxicity) throws IOException- Throws:
IOException
-
getName
public String getName()
-
getStream
public ToxicDirection getStream()
-
getToxicity
public float getToxicity()
-
remove
public void remove() throws IOException- Throws:
IOException
-
-