
rt.pipeline.pipe.use.ValidatorInterceptor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rts-pipeline Show documentation
Show all versions of rts-pipeline Show documentation
Framework to build reactive services for reactive application front-ends
The newest version!
package rt.pipeline.pipe.use;
import com.google.common.base.Objects;
import rt.async.pubsub.Message;
import rt.pipeline.IComponent;
import rt.pipeline.pipe.PipeContext;
@SuppressWarnings("all")
public class ValidatorInterceptor implements IComponent {
@Override
public void apply(final PipeContext ctx) {
final Message msg = ctx.getMessage();
boolean _equals = Objects.equal(msg.id, null);
if (_equals) {
RuntimeException _runtimeException = new RuntimeException("No mandatory field \'id\'");
ctx.fail(_runtimeException);
}
boolean _equals_1 = Objects.equal(msg.cmd, null);
if (_equals_1) {
RuntimeException _runtimeException_1 = new RuntimeException("No mandatory field \'cmd\'");
ctx.fail(_runtimeException_1);
}
boolean _equals_2 = Objects.equal(msg.clt, null);
if (_equals_2) {
RuntimeException _runtimeException_2 = new RuntimeException("No mandatory field \'client\'");
ctx.fail(_runtimeException_2);
}
boolean _equals_3 = Objects.equal(msg.path, null);
if (_equals_3) {
RuntimeException _runtimeException_3 = new RuntimeException("No mandatory field \'path\'");
ctx.fail(_runtimeException_3);
}
ctx.next();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy