Use value types for class and type in DNS entries to make them immune to parameter order bugs

I just spent a few hours debugging why I was getting garbage responses from my embryonic jetty-based DNS server, and found it was because I had CLASS and TYPE reversed when passing them to `DnsResource`'s constructor.  Having two `int` parameters next to each other which mean very different things is dangerous and exactly what Java types are there to help avoid.

So that nobody else has this problem, I've created this patch which adds two classes, `DnsType` and `DnsClass` which are wrappers for the protocol values (and also have names).  Includes tests which pass and patches the rest of netty-dns to use them.
Yeah, it should be a class rather than an enum. The reason we did not
introduce an enum at the first place was the extensibility.
2014. 7. 22. 오전 3:31에 "Tim Boudreau" <notifications@github.com>님이 작성:

> In codec-dns/src/main/java/io/netty/handler/codec/dns/DnsType.java:
>
> > + *   http://www.apache.org/licenses/LICENSE-2.0
> > + *
> > + * Unless required by applicable law or agreed to in writing, software
> > + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
> > + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
> > + * License for the specific language governing permissions and limitations
> > + * under the License.
> > + */
> > +package io.netty.handler.codec.dns;
> > +
> > +import java.lang.reflect.Field;
> > +
> > +/**
> > + * Represents a DNS record type.
> > + */
> > +public class DnsType {
>
> I thought about it, but that makes it unusable with new versions of the
> protocol, or for prototyping changes, or for just doing weird stuff.
>
> We could do public enum DysTypes implements DnsType though. Worth it?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/netty/netty/pull/2688/files#r15220437>.
>