modulecompletekey.java

来自「模块化您的应用系统」· Java 代码 · 共 42 行

JAVA
42
字号
/*
 * Created by IntelliJ IDEA.
 * User: Mike
 * Date: Jul 29, 2004
 * Time: 3:19:33 PM
 */
package com.opensymphony.tonic;

public class ModuleCompleteKey
{
    private String pluginKey;
    private String moduleKey;

    public ModuleCompleteKey(String completeKey)
    {
        if (completeKey == null)
            throw new IllegalArgumentException("Invalid complete key specified: " + completeKey);
            
        final int sepIdx = completeKey.indexOf(":");

        if (sepIdx <= 0 || (sepIdx == completeKey.length() - 1))
            throw new IllegalArgumentException("Invalid complete key specified: " + completeKey);

        pluginKey = completeKey.substring(0, sepIdx);
        moduleKey = completeKey.substring(sepIdx + 1);
    }

    public String getModuleKey()
    {
        return moduleKey;
    }

    public String getPluginKey()
    {
        return pluginKey;
    }

    public String getCompleteKey()
    {
        return pluginKey + ":" + moduleKey;
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?