Skip to content

Instantly share code, notes, and snippets.

@jwir3
Created April 24, 2014 15:33
Show Gist options
  • Save jwir3/11259018 to your computer and use it in GitHub Desktop.
Save jwir3/11259018 to your computer and use it in GitHub Desktop.
Shortcode Resolver
//-----------------------------------------------------------------------
// EXPERIENCE_TYPE
// Created by bradbenson
// Copyright (c) 2014 by Jingit LLC
// All Rights Reserved
//
//
package com.jingit.mobile;
/**
* Different types of engagements.
*/
public enum EXPERIENCE_TYPE {
// Values
Unknown,
Engagement,
Offer,
Channel;
public static EXPERIENCE_TYPE getType(String a_strType)
{
EXPERIENCE_TYPE result = EXPERIENCE_TYPE.Unknown; // Result value - assume failure.
// String non-null?
if( a_strType != null ) {
// Get type string and turn it into an enumeration
if(a_strType.equalsIgnoreCase("STANDARD") || a_strType.equalsIgnoreCase("CHECKIN")) {
result = EXPERIENCE_TYPE.Engagement;
} else if(a_strType.equalsIgnoreCase("OFFER")) {
result = EXPERIENCE_TYPE.Offer;
} else if(a_strType.equalsIgnoreCase("CHANNEL")) {
result = EXPERIENCE_TYPE.Channel;
}
}
// Done!
return result;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment