123456789101112131415161718192021222324252627282930313233343536 |
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
- package com.md87.nat;
-
- /**
- *
- * @author chris
- */
- public enum NatType {
-
- OPEN(true),
- FULL_CONE(true),
- RESTRICTED_CONE(false),
- PORT_RESTRICTED_CONE(false),
- SYMMETRIC(false);
-
- private final boolean canTraverseWithSymmetric;
-
- NatType(final boolean canTraverseWithSymmetric) {
- this.canTraverseWithSymmetric = canTraverseWithSymmetric;
- }
-
- public boolean canTraverseWith(final NatType type) {
- if (type == SYMMETRIC) {
- return canTraverseWithSymmetric;
- } else if (this == SYMMETRIC) {
- return type.canTraverseWith(this);
- } else {
- return true;
- }
- }
-
- }
|