001/** 002 * 003 * Copyright 2018-2020 Florian Schmaus 004 * 005 * Licensed under the Apache License, Version 2.0 (the "License"); 006 * you may not use this file except in compliance with the License. 007 * You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.jivesoftware.smack.fsm; 018 019import org.jivesoftware.smack.c2s.ModularXmppClientToServerConnection; 020import org.jivesoftware.smack.c2s.internal.ModularXmppClientToServerConnectionInternal; 021import org.jivesoftware.smack.c2s.internal.WalkStateGraphContext; 022 023public class NoOpState extends State { 024 025 /** 026 * Constructs a NoOpState. Note that the signature of this constructor is designed so that it mimics States which 027 * are non-static inner classes of ModularXmppClientToServerConnection. That is why the first argument is not used. 028 * 029 * @param connection the connection. 030 * @param stateDescriptor the related state descriptor 031 * @param connectionInternal the internal connection API. 032 */ 033 @SuppressWarnings("UnusedVariable") 034 protected NoOpState(ModularXmppClientToServerConnection connection, StateDescriptor stateDescriptor, ModularXmppClientToServerConnectionInternal connectionInternal) { 035 super(stateDescriptor, connectionInternal); 036 } 037 038 @Override 039 public StateTransitionResult.Success transitionInto(WalkStateGraphContext walkStateGraphContext) { 040 // Transition into a NoOpState always succeeds. 041 return StateTransitionResult.Success.EMPTY_INSTANCE; 042 } 043}