-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bippity boppity boop
- Loading branch information
kashike
committed
Jan 25, 2017
1 parent
2f27732
commit 353b3f0
Showing
6 changed files
with
589 additions
and
19 deletions.
There are no files selected for viewing
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
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
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
111 changes: 111 additions & 0 deletions
111
src/test/java/org/kitteh/irc/client/library/implementation/TestUser.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
package org.kitteh.irc.client.library.implementation; | ||
|
||
import org.kitteh.irc.client.library.Client; | ||
import org.kitteh.irc.client.library.element.User; | ||
|
||
import javax.annotation.Nonnull; | ||
import javax.annotation.Nullable; | ||
import java.util.Collections; | ||
import java.util.Optional; | ||
import java.util.Set; | ||
|
||
public class TestUser implements User { | ||
private final String nick; | ||
private final String user; | ||
private final String host; | ||
private final Optional<String> account; | ||
|
||
public TestUser(@Nonnull String nick, @Nonnull String user, @Nonnull String host, @Nullable String account) { | ||
this.nick = nick; | ||
this.user = user; | ||
this.host = host; | ||
this.account = Optional.ofNullable(account); | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public Client getClient() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public long getCreationTime() { | ||
return 0L; | ||
} | ||
|
||
@Override | ||
public boolean isStale() { | ||
return false; | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public String getMessagingName() { | ||
return this.nick; | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public Optional<String> getAccount() { | ||
return this.account; | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public Set<String> getChannels() { | ||
return Collections.emptySet(); | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public String getName() { | ||
return this.nick + '!' + this.user + '@' + this.host; | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public String getHost() { | ||
return this.host; | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public String getNick() { | ||
return this.nick; | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public Optional<String> getOperatorInformation() { | ||
return Optional.empty(); | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public Optional<String> getRealName() { | ||
return Optional.empty(); | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public Optional<String> getServer() { | ||
return Optional.empty(); | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public String getUserString() { | ||
return this.user; | ||
} | ||
|
||
@Override | ||
public boolean isAway() { | ||
return false; | ||
} | ||
|
||
@Nonnull | ||
@Override | ||
public String toString() { | ||
return this.getName() + (this.account != null ? " (account: " + this.account + '}' : ""); | ||
} | ||
} |
Oops, something went wrong.