X-Git-Url: https://git.hedgecode.org/?a=blobdiff_plain;f=chesshog-uci%2Fsrc%2Fmain%2Fjava%2Forg%2Fhedgecode%2Fchess%2Fuci%2Fcommand%2FCommandParams.java;fp=chesshog-uci%2Fsrc%2Fmain%2Fjava%2Forg%2Fhedgecode%2Fchess%2Fuci%2Fcommand%2FCommandParams.java;h=4baf6b7206d29a5a6681ae6f1fb8454db87ff783;hb=1c1d899a4dc4144e6b8ec93c0afcda09b38b5f6f;hp=0000000000000000000000000000000000000000;hpb=1fbf14530416c16f1c6fa5ee3e589482dd722a5d;p=chesshog.git diff --git a/chesshog-uci/src/main/java/org/hedgecode/chess/uci/command/CommandParams.java b/chesshog-uci/src/main/java/org/hedgecode/chess/uci/command/CommandParams.java new file mode 100644 index 0000000..4baf6b7 --- /dev/null +++ b/chesshog-uci/src/main/java/org/hedgecode/chess/uci/command/CommandParams.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2018. Developed by Hedgecode. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.hedgecode.chess.uci.command; + +import org.hedgecode.chess.uci.UCIConstants; + +/** + * Container class for UCI command with parameters. + * + * @author Dmitry Samoshin aka gotty + */ +public final class CommandParams { + + private String name; + private String params; + + public CommandParams(String command) { + String[] arrCommand = command.trim().split( + UCIConstants.COMMAND_SEP_REGEX, 2 + ); + name = arrCommand[0]; + params = arrCommand.length > 1 ? arrCommand[1] : null; + } + + public String getName() { + return name; + } + + public String getParams() { + return params; + } + +}