ParsedMessage.java 2.07 KB
Newer Older
1
package com.owlmaddie.message;
2

3
import java.util.Arrays;
4
import java.util.List;
5
import java.util.Random;
6 7 8 9 10 11

/**
 * The {@code ParsedMessage} class represents a list of behaviors and a cleaned message.
 */
public class ParsedMessage {
    private String cleanedMessage;
12
    private String originalMessage;
13
    private List<Behavior> behaviors;
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
    private List<String> noResponseMessages = Arrays.asList(
            "<no response>",
            "<silence>",
            "<stares>",
            "<blinks>",
            "<looks away>",
            "<sighs>",
            "<shrugs>",
            "<taps foot>",
            "<yawns>",
            "<examines nails>",
            "<whistles softly>",
            "<shifts uncomfortably>",
            "<glances around>",
            "<pretends not to hear>",
            "<hums quietly>",
            "<fiddles with something>",
            "<gazes into the distance>",
            "<smirks>",
            "<raises an eyebrow>",
            "<clears throat>",
            "<peers over your shoulder>",
            "<fakes a smile>",
            "<checks the time>",
            "<doodles in the air>",
            "<mutters under breath>",
            "<adjusts an imaginary tie>",
            "<counts imaginary stars>",
            "<plays with a nonexistent pet>"
    );
44

45
    public ParsedMessage(String cleanedMessage, String originalMessage, List<Behavior> behaviors) {
46
        this.cleanedMessage = cleanedMessage;
47
        this.originalMessage = originalMessage;
48 49 50
        this.behaviors = behaviors;
    }

51
    // Get cleaned message (no behaviors)
52
    public String getCleanedMessage() {
53 54 55 56 57 58 59 60 61 62 63 64 65
        return cleanedMessage.trim();
    }

    // Get random no response message
    public String getRandomNoResponseMessage() {
        Random random = new Random();
        int index = random.nextInt(noResponseMessages.size());
        return noResponseMessages.get(index).trim();
    }

    // Get original message
    public String getOriginalMessage() {
        return originalMessage.trim();
66 67 68 69 70 71
    }

    public List<Behavior> getBehaviors() {
        return behaviors;
    }
}