O'Reilly logo

Drools JBoss Rules 5.0 Developer's Guide by Michal Bali, Bogdan Brinzarea

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementation

In this section, we'll define the implementation for various interfaces that we've defined in this chapter. You can skip this section if you like. It is here for completeness.

First, let's look at an implementation of the Message interface, which is shown in the following code. The message is essentially another POJO, so it will basically have get and set methods, and it will also override the equals, hashCode, and toString methods.

import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang.builder.HashCodeBuilder; import org.apache.commons.lang.builder.ToStringBuilder; //... other imports public class DefaultMessage implements Message, Serializable { private Message.Type type; private String messageKey; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required