Package info.jtrac.mylyn.domain

Source Code of info.jtrac.mylyn.domain.ItemRefId

package info.jtrac.mylyn.domain;

import info.jtrac.mylyn.exception.InvalidRefIdException;

public class ItemRefId {

    private long sequenceNum;
    private String prefixCode;
   
    public ItemRefId(String refId) throws InvalidRefIdException {
        int pos = refId.indexOf('-');
        if (pos == -1) {
            throw new InvalidRefIdException("invalid ref id");
        }
        try {
            sequenceNum = Long.parseLong(refId.substring(pos + 1));
        } catch (NumberFormatException e) {
            throw new InvalidRefIdException("invalid ref id");
        }
        prefixCode = refId.substring(0, pos).toUpperCase();
    }

    public String getPrefixCode() {
        return prefixCode;
    }

    public long getSequenceNum() {
        return sequenceNum;
   
 
}
TOP

Related Classes of info.jtrac.mylyn.domain.ItemRefId

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.