コード例 #1
0
 @Override
 public <F extends OFValueType<F>> F get(MatchField<F> field)
     throws UnsupportedOperationException {
   OFOxm<F> value = getOxm(field);
   if (value == null) return null;
   return value.getValue();
 }
コード例 #2
0
 @Override
 public <F extends OFValueType<F>> Masked<F> getMasked(MatchField<F> field)
     throws UnsupportedOperationException {
   OFOxm<F> value = getOxm(field);
   if (value == null || !value.isMasked()) return null;
   // TODO: If changing OXMs to extend Masked, then use it here
   return Masked.of(value.getValue(), value.getMask());
 }
コード例 #3
0
 @Override
 protected MatchField<?> computeNext() {
   while (oxmIterator.hasNext()) {
     OFOxm<?> oxm = oxmIterator.next();
     if (oxm.getMatchField().arePrerequisitesOK(OFMatchV3Ver14.this)) return oxm.getMatchField();
   }
   endOfData();
   return null;
 }
コード例 #4
0
  @Override
  public boolean isPartiallyMasked(MatchField<?> field) {
    if (!supports(field))
      throw new UnsupportedOperationException(
          "OFMatchV3Ver14 does not support matching on field " + field.getName());

    OFOxm<?> oxm = this.oxmList.get(field);

    return oxm != null && oxm.isMasked();
  }
コード例 #5
0
  @Override
  public <F extends OFValueType<F>> F get(MatchField<F> field)
      throws UnsupportedOperationException {
    if (!supports(field))
      throw new UnsupportedOperationException(
          "OFMatchV3Ver14 does not support matching on field " + field.getName());

    OFOxm<F> oxm = this.oxmList.get(field);

    if (oxm == null || !field.arePrerequisitesOK(this)) return null;

    return oxm.getValue();
  }
コード例 #6
0
  @Override
  public <F extends OFValueType<F>> Masked<F> getMasked(MatchField<F> field)
      throws UnsupportedOperationException {
    if (!supportsMasked(field))
      throw new UnsupportedOperationException(
          "OFMatchV3Ver14 does not support masked matching on field " + field.getName());

    OFOxm<F> oxm = this.oxmList.get(field);

    if (oxm == null || !field.arePrerequisitesOK(this)) return null;

    if (oxm.getMask() == null) return null;

    // TODO: Make OfOxm extend Masked and just return the OXM?
    return Masked.of(oxm.getValue(), oxm.getMask());
  }
コード例 #7
0
  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;

    result = prime * result + ((field == null) ? 0 : field.hashCode());
    return result;
  }
コード例 #8
0
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null) return false;
    if (getClass() != obj.getClass()) return false;
    OFActionSetFieldVer12 other = (OFActionSetFieldVer12) obj;

    if (field == null) {
      if (other.field != null) return false;
    } else if (!field.equals(other.field)) return false;
    return true;
  }
コード例 #9
0
 @Override
 public boolean isPartiallyMasked(MatchField<?> field) {
   OFOxm<?> value = getOxm(field);
   return (value != null && value.isMasked());
 }
コード例 #10
0
 @Override
 public boolean isExact(MatchField<?> field) {
   OFOxm<?> value = getOxm(field);
   return (value != null && !value.isMasked());
 }