public String getOffset(OffsetType offsetType) {
      if (offsetType.equals(OffsetType.OLDEST)) {
        return getOldestOffset();
      } else if (offsetType.equals(OffsetType.NEWEST)) {
        return getNewestOffset();
      } else if (offsetType.equals(OffsetType.UPCOMING)) {
        return getUpcomingOffset();
      } else {
        throw new SamzaException("Invalid offset type defined " + offsetType + ".");
      }
    }
@param offsetType
         The type of offset to get. Either oldest, newest, or upcoming.
@return The corresponding offset for the offset type requested.
samza-api/src/main/java/org/apache/samza/system/SystemStreamMetadata.java