Commonize into PathUtils; On Linux/BSD try to use xdg-open/x-www-browser if Java...
[SquirrelJME.git] / buildSrc / src / main / java / cc / squirreljme / plugin / util / NoteUsers.java
blob9f0fd0203a2ce229f9623cf042962f625a7be211
1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
3 // SquirrelJME
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the GNU General Public License v3+, or later.
7 // See license.mkd for licensing and copyright information.
8 // ---------------------------------------------------------------------------
10 package cc.squirreljme.plugin.util;
12 import java.time.LocalDate;
13 import java.util.Map;
14 import java.util.TreeMap;
16 /**
17 * Represents users.
19 * @since 2020/06/27
21 public class NoteUsers
23 /** Represents the users. */
24 public final Map<String, NoteUser> users =
25 new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
27 /**
28 * Adds the user.
30 * @param __userName The user name.
31 * @param __date The date.
32 * @param __fileName The file name.
33 * @throws NullPointerException On null arguments.
34 * @since 2020/06/27
36 public NoteUser add(String __userName, LocalDate __date,
37 String __fileName)
38 throws NullPointerException
40 if (__userName == null || __date == null || __fileName == null)
41 throw new NullPointerException("NARG");
43 NoteUser rv = this.users.computeIfAbsent(__userName,
44 __key -> new NoteUser(__key));
46 rv.add(__date, __fileName);
48 return rv;