Created
November 29, 2023 09:10
-
-
Save vladdedita/2c38c634f17a1aaeaaf0d0b0fb83c163 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface MessageProcessor<T> { | |
void process(T message); | |
} | |
@Component | |
public class TextMessageProcessor implements MessageProcessor<TextMessage> { | |
@Override | |
public void process(TextMessage message) { | |
// Processing logic for text messages | |
} | |
} | |
@Component | |
public class ImageMessageProcessor implements MessageProcessor<ImageMessage> { | |
@Override | |
public void process(ImageMessage message) { | |
// Processing logic for image messages | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment