aboutsummaryrefslogtreecommitdiffstats
path: root/messagebus/src/main/java/com/yahoo/messagebus/test/SimpleMessage.java
blob: 5b5ba9c64f4d89e4b87c88754313ebcbfe65bb85 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
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
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.messagebus.test;

import com.yahoo.messagebus.Message;
import com.yahoo.text.Utf8String;

/**
 * @author havardpe
 */
public class SimpleMessage extends Message {

    private String value;

    public SimpleMessage(String value) {
        this.value = value;
    }

    @Override
    public int getType() {
        return SimpleProtocol.MESSAGE;
    }

    @Override
    public Utf8String getProtocol() {
        return SimpleProtocol.NAME;
    }

    @Override
    public int getApproxSize() {
        return value.length();
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}