Documentation
¶
Index ¶
- type AntMatcher
- type ArrayList
- func (this *ArrayList[T]) Add(elements ...T) bool
- func (this *ArrayList[T]) AddAll(c Collection[T]) bool
- func (this *ArrayList[T]) AddAt(index int, element T)
- func (this *ArrayList[T]) Clear()
- func (this *ArrayList[T]) Contains(element T) bool
- func (this *ArrayList[T]) ContainsAll(c Collection[T]) bool
- func (this *ArrayList[T]) Equals(c Collection[T]) bool
- func (this *ArrayList[T]) Get(index int) T
- func (this *ArrayList[T]) IndexOf(element T) int
- func (this *ArrayList[T]) IsEmpty() bool
- func (this *ArrayList[T]) LastIndexOf(element T) int
- func (this *ArrayList[T]) MarshalJSON() ([]byte, error)
- func (this *ArrayList[T]) Remove(element T) bool
- func (this *ArrayList[T]) RemoveAll(c Collection[T]) bool
- func (this *ArrayList[T]) RemoveAt(index int) T
- func (this *ArrayList[T]) RetainAll(c Collection[T]) bool
- func (this *ArrayList[T]) Scan(src any) error
- func (this *ArrayList[T]) Seq() iter.Seq[T]
- func (this *ArrayList[T]) Set(index int, element T) T
- func (this *ArrayList[T]) Size() int
- func (this *ArrayList[T]) Stream() Stream[T]
- func (this *ArrayList[T]) SubList(fromIndex, toIndex int) List[T]
- func (this *ArrayList[T]) ToSlice() []T
- func (this *ArrayList[T]) UnmarshalJSON(data []byte) error
- func (this *ArrayList[T]) Value() (driver.Value, error)
- type CaseUtils
- func (this CaseUtils) Capitalize() CaseUtils
- func (this CaseUtils) LowerCase() CaseUtils
- func (this CaseUtils) SnakeCase() CaseUtils
- func (this CaseUtils) String() string
- func (this CaseUtils) ToString() String
- func (this CaseUtils) Uncapitalize() CaseUtils
- func (this CaseUtils) UpperCase() CaseUtils
- type ConcurrentHashMap
- func (this *ConcurrentHashMap[K, V]) Clear()
- func (this *ConcurrentHashMap[K, V]) ContainsKey(key K) bool
- func (this *ConcurrentHashMap[K, V]) Delete(f func(key K, val V) bool)
- func (this *ConcurrentHashMap[K, V]) Equals(m Map[K, V]) bool
- func (this *ConcurrentHashMap[K, V]) Get(key K) Optional[V]
- func (this *ConcurrentHashMap[K, V]) IsEmpty() bool
- func (this *ConcurrentHashMap[K, V]) Iterator() iter.Seq2[K, V]
- func (this *ConcurrentHashMap[K, V]) Map() map[K]V
- func (this *ConcurrentHashMap[K, V]) MarshalJSON() ([]byte, error)
- func (this *ConcurrentHashMap[K, V]) Merge(m Map[K, V])
- func (this ConcurrentHashMap[K, V]) New() *ConcurrentHashMap[K, V]
- func (this *ConcurrentHashMap[K, V]) Put(key K, val V) Map[K, V]
- func (this *ConcurrentHashMap[K, V]) PutAll(m Map[K, V]) Map[K, V]
- func (this *ConcurrentHashMap[K, V]) Remove(key K) Optional[V]
- func (this *ConcurrentHashMap[K, V]) Size() int
- func (this *ConcurrentHashMap[K, V]) UnmarshalJSON(data []byte) error
- type HashMap
- func (this HashMap[K, V]) Clear()
- func (this HashMap[K, V]) Clone() HashMap[K, V]
- func (this HashMap[K, V]) ContainsKey(key K) bool
- func (this HashMap[K, V]) Delete(f func(key K, val V) bool)
- func (this HashMap[K, V]) Equals(m Map[K, V]) bool
- func (this HashMap[K, V]) Get(key K) Optional[V]
- func (this HashMap[K, V]) IsEmpty() bool
- func (this HashMap[K, V]) Iterator() iter.Seq2[K, V]
- func (this HashMap[K, V]) Map() map[K]V
- func (this HashMap[K, V]) MarshalJSON() ([]byte, error)
- func (this HashMap[K, V]) Merge(m Map[K, V])
- func (this HashMap[K, V]) Put(key K, val V) Map[K, V]
- func (this HashMap[K, V]) PutAll(m Map[K, V]) Map[K, V]
- func (this HashMap[K, V]) Remove(key K) Optional[V]
- func (this HashMap[K, V]) Size() int
- func (this HashMap[K, V]) UnmarshalJSON(data []byte) error
- type HashSet
- func (this *HashSet[T]) Add(elements ...T) bool
- func (this *HashSet[T]) AddAll(c Collection[T]) bool
- func (this *HashSet[T]) Clear()
- func (this *HashSet[T]) Contains(element T) bool
- func (this *HashSet[T]) ContainsAll(c Collection[T]) bool
- func (this *HashSet[T]) Equals(c Collection[T]) bool
- func (this *HashSet[T]) IsEmpty() bool
- func (this *HashSet[T]) MarshalJSON() ([]byte, error)
- func (this *HashSet[T]) Remove(element T) bool
- func (this *HashSet[T]) RemoveAll(c Collection[T]) bool
- func (this *HashSet[T]) RetainAll(c Collection[T]) bool
- func (this *HashSet[T]) Scan(src any) error
- func (this *HashSet[T]) Seq() iter.Seq[T]
- func (this *HashSet[T]) Size() int
- func (this *HashSet[T]) Stream() Stream[T]
- func (this *HashSet[T]) ToSlice() []T
- func (this *HashSet[T]) UnmarshalJSON(data []byte) error
- func (this *HashSet[T]) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AntMatcher ¶
type AntMatcher struct {
// contains filtered or unexported fields
}
AntMatcher is an implementation for Ant-style path patterns.
Standard Ant path matching URLs rules apply :
- ? matches one character
- * matches zero or more characters
- ** matches zero or more directories in a path
Examples
- "com/t?st.html" — matches "com/test.html" but also "com/tast.html" or "com/txst.html"
- "com/*.html" — matches all .html files in the com directory
- "com/**/test.html" — matches all test.html files underneath the com path
- "com/beamfoundry/**/*.html" — matches all .html files underneath the org/beamfoundry path
- "org/**/services/bla.html" — matches "org/beamfoundry/services/bla.html" but also "org/beamfoundry/testing/services/bla.html" and "org/services/bla.html"
func (*AntMatcher) Match ¶
func (this *AntMatcher) Match(n []byte) bool
Match() returns whether the n byte slice match the pattern.
TODO: With 1.27 use generic method instead of two methods.
func (*AntMatcher) MatchString ¶
func (this *AntMatcher) MatchString(s string) bool
MatchString() returns whether the s string match the pattern
TODO: With 1.27 use generic method instead of two methods.
func (AntMatcher) New ¶
func (this AntMatcher) New(pattern string) (*AntMatcher, Error)
New() returns optionally and AntMatcher object pointer.
Internally the string pattern is transformed into a regexp.Regexp. In case the regexp compilation fails an github.com/BeamFoundry/rays/pkg/lang.Error will be returned.
func (*AntMatcher) String ¶
func (this *AntMatcher) String() string
String() returns the original string passed to the constructor
type ArrayList ¶ added in v0.3.0
type ArrayList[T any] struct { AbstractList[T] }
ArrayList is a resizable-array implementation of the List interface.
func NewArrayList ¶ added in v0.3.0
NewArrayList creates a new ArrayList containing the given elements.
func NewArrayListWithCapacity ¶ added in v0.3.0
NewArrayListWithCapacity creates an empty ArrayList with the specified initial capacity.
func (*ArrayList[T]) Add ¶ added in v0.3.0
Add appends the specified elements to the end of this list. Returns true if this list changed as a result of the call.
func (*ArrayList[T]) AddAll ¶ added in v0.3.0
AddAll appends all of the elements in the specified collection to the end of this list. Returns true if this list changed as a result of the call.
func (*ArrayList[T]) AddAt ¶ added in v0.3.0
AddAt inserts the specified element at the specified position in this list. Shifts the element currently at that position (if any) and any subsequent elements to the right. Panics with IndexOutOfBoundsError if the index is out of range.
func (*ArrayList[T]) Clear ¶ added in v0.3.0
func (this *ArrayList[T]) Clear()
Clear removes all elements from this list.
func (*ArrayList[T]) Contains ¶ added in v0.3.0
Contains returns true if this list contains the specified element.
func (*ArrayList[T]) ContainsAll ¶ added in v0.3.0
ContainsAll returns true if this list contains all of the elements in the specified collection.
func (*ArrayList[T]) Equals ¶ added in v0.3.0
Equals returns true if the specified collection is equal to this list.
func (*ArrayList[T]) Get ¶ added in v0.3.0
Get returns the element at the specified position in this list. Panics with IndexOutOfBoundsError if the index is out of range.
func (*ArrayList[T]) IndexOf ¶ added in v0.3.0
IndexOf returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.
func (*ArrayList[T]) IsEmpty ¶ added in v0.3.0
IsEmpty returns true if this list contains no elements.
func (*ArrayList[T]) LastIndexOf ¶ added in v0.3.0
LastIndexOf returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element.
func (*ArrayList[T]) MarshalJSON ¶ added in v0.3.0
MarshalJSON implements json.Marshaler.
func (*ArrayList[T]) Remove ¶ added in v0.3.0
Remove removes the first occurrence of the specified element from this list, if it is present. Returns true if an element was removed.
func (*ArrayList[T]) RemoveAll ¶ added in v0.3.0
RemoveAll removes all of this list's elements that are also contained in the specified collection. Returns true if this list changed as a result of the call.
func (*ArrayList[T]) RemoveAt ¶ added in v0.3.0
RemoveAt removes the element at the specified position in this list. Shifts any subsequent elements to the left. Returns the element that was removed from the list. Panics with IndexOutOfBoundsError if the index is out of range.
func (*ArrayList[T]) RetainAll ¶ added in v0.3.0
RetainAll retains only the elements in this list that are contained in the specified collection. Returns true if this list changed as a result of the call.
func (*ArrayList[T]) Seq ¶ added in v0.3.0
Seq returns an iterator sequence over the elements in this list.
func (*ArrayList[T]) Set ¶ added in v0.3.0
Set replaces the element at the specified position in this list with the specified element. Returns the element previously at the specified position. Panics with IndexOutOfBoundsError if the index is out of range.
func (*ArrayList[T]) Stream ¶ added in v0.3.0
func (this *ArrayList[T]) Stream() Stream[T]
Stream returns a sequential Stream with this list as its source.
func (*ArrayList[T]) SubList ¶ added in v0.3.0
SubList returns an independent copy of the portion of this list between fromIndex, inclusive, and toIndex, exclusive. Changes to the returned list do not affect the original list. Panics with IndexOutOfBoundsError if the indices are out of range.
func (*ArrayList[T]) ToSlice ¶ added in v0.3.0
func (this *ArrayList[T]) ToSlice() []T
ToSlice returns a copy of the underlying slice.
func (*ArrayList[T]) UnmarshalJSON ¶ added in v0.3.0
UnmarshalJSON implements json.Unmarshaler.
type CaseUtils ¶
type CaseUtils string
CaseUtils is a type redefinition of "string"
As such it can be constructed using the type name as a function.
Example :
CaseUtils("test").UpperCase().String() // Returns "TEST"
func (CaseUtils) Capitalize ¶
Capitalize() will change the first letter to uppercase case. No other letters are changed.
func (CaseUtils) ToString ¶
func (this CaseUtils) ToString() String
ToString() Returns a github.com/BeamFoundry/rays/pkg/lang.String version of this CaseUtils
func (CaseUtils) Uncapitalize ¶
Capitalize() will change the first letter to lowercase case. No other letters are changed.
type ConcurrentHashMap ¶
type ConcurrentHashMap[K comparable, V any] struct { // contains filtered or unexported fields }
ConcurrentHashMap is a [Map] implementation that is thread-safe
Internally it's just a [HasmMap] combined to a sync.RWMutex
TODO: Review lock.
func (*ConcurrentHashMap[K, V]) Clear ¶
func (this *ConcurrentHashMap[K, V]) Clear()
Clear() implements [Map.Clear]
func (*ConcurrentHashMap[K, V]) ContainsKey ¶
func (this *ConcurrentHashMap[K, V]) ContainsKey(key K) bool
ContainsKey() implements [Map.ContainsKey]
func (*ConcurrentHashMap[K, V]) Delete ¶
func (this *ConcurrentHashMap[K, V]) Delete(f func(key K, val V) bool)
Delete() implements [Map.Delete]
func (*ConcurrentHashMap[K, V]) Equals ¶
func (this *ConcurrentHashMap[K, V]) Equals(m Map[K, V]) bool
Equals() implements [Map.Equals].
func (*ConcurrentHashMap[K, V]) Get ¶
func (this *ConcurrentHashMap[K, V]) Get(key K) Optional[V]
Get() implements [Map.Get]
func (*ConcurrentHashMap[K, V]) IsEmpty ¶
func (this *ConcurrentHashMap[K, V]) IsEmpty() bool
IsEmpty() implements [Map.IsEmpty]
func (*ConcurrentHashMap[K, V]) Iterator ¶
func (this *ConcurrentHashMap[K, V]) Iterator() iter.Seq2[K, V]
Iterator() implements [Map.Iterator]
func (*ConcurrentHashMap[K, V]) Map ¶
func (this *ConcurrentHashMap[K, V]) Map() map[K]V
Map() implements [Map.Map]
func (*ConcurrentHashMap[K, V]) MarshalJSON ¶
func (this *ConcurrentHashMap[K, V]) MarshalJSON() ([]byte, error)
MashalJSON() implements json.Marshaler
func (*ConcurrentHashMap[K, V]) Merge ¶
func (this *ConcurrentHashMap[K, V]) Merge(m Map[K, V])
Merge() implements [Map.Merge].
func (ConcurrentHashMap[K, V]) New ¶
func (this ConcurrentHashMap[K, V]) New() *ConcurrentHashMap[K, V]
New() creates a new ConcurrentHashMap
func (*ConcurrentHashMap[K, V]) Put ¶
func (this *ConcurrentHashMap[K, V]) Put(key K, val V) Map[K, V]
Put() implements [Map.Put]
func (*ConcurrentHashMap[K, V]) PutAll ¶
func (this *ConcurrentHashMap[K, V]) PutAll(m Map[K, V]) Map[K, V]
PutAll() implements [Map.PutAll]
func (*ConcurrentHashMap[K, V]) Remove ¶
func (this *ConcurrentHashMap[K, V]) Remove(key K) Optional[V]
Remove() implements [Map.Remove]
func (*ConcurrentHashMap[K, V]) Size ¶
func (this *ConcurrentHashMap[K, V]) Size() int
Size() implements [Map.Size]
func (*ConcurrentHashMap[K, V]) UnmarshalJSON ¶
func (this *ConcurrentHashMap[K, V]) UnmarshalJSON(data []byte) error
UnmarshalJSON() implements json.Unmarshal
type HashMap ¶
type HashMap[K comparable, V any] struct { // contains filtered or unexported fields }
HashMap is default [Map] implementation
func NewHashMap ¶
func NewHashMap[K comparable, V any]() HashMap[K, V]
NewHashMap() creates a new, empty HashMap
func NewHashMapFor ¶
func NewHashMapFor[K comparable, V any](m map[K]V) HashMap[K, V]
NewHashMapFor() encapsulate an existing map as a HashMap
func NewHashMapFrom ¶
func NewHashMapFrom[K comparable, V any](m map[K]V) HashMap[K, V]
NewHashMapFrom() encapsulate an existing map as a HashMap and clones it.
func (HashMap[K, V]) ContainsKey ¶
ContainsKey() implements [Map.ContainsKey]
func (HashMap[K, V]) Get ¶
func (this HashMap[K, V]) Get(key K) Optional[V]
Get() implements [Map.Get]
func (HashMap[K, V]) MarshalJSON ¶
MashalJSON() implements json.Marshaler
func (HashMap[K, V]) Merge ¶
func (this HashMap[K, V]) Merge(m Map[K, V])
Merge() implements [Map.Merge].
func (HashMap[K, V]) Put ¶
func (this HashMap[K, V]) Put(key K, val V) Map[K, V]
Put() implements [Map.Put]
func (HashMap[K, V]) PutAll ¶
func (this HashMap[K, V]) PutAll(m Map[K, V]) Map[K, V]
PutAll() implements [Map.PutAll]
func (HashMap[K, V]) Remove ¶
func (this HashMap[K, V]) Remove(key K) Optional[V]
Remove() implements [Map.Remove]
func (HashMap[K, V]) UnmarshalJSON ¶
UnmarshalJSON() implements json.Unmarshal
type HashSet ¶ added in v0.3.0
type HashSet[T comparable] struct { AbstractSet[T] }
HashSet is a hash table based implementation of the Set interface.
func NewHashSet ¶ added in v0.3.0
func NewHashSet[T comparable](elements ...T) *HashSet[T]
NewHashSet creates a new HashSet containing the given elements.
func NewHashSetWithCapacity ¶ added in v0.3.0
func NewHashSetWithCapacity[T comparable](capacity int) *HashSet[T]
NewHashSetWithCapacity creates an empty HashSet with the specified initial capacity.
func (*HashSet[T]) Add ¶ added in v0.3.0
Add adds the specified elements to this set. Returns true if this set changed as a result of the call.
func (*HashSet[T]) AddAll ¶ added in v0.3.0
AddAll adds all of the elements in the specified collection to this set. Returns true if this set changed as a result of the call.
func (*HashSet[T]) Clear ¶ added in v0.3.0
func (this *HashSet[T]) Clear()
Clear removes all elements from this set.
func (*HashSet[T]) Contains ¶ added in v0.3.0
Contains returns true if this set contains the specified element.
func (*HashSet[T]) ContainsAll ¶ added in v0.3.0
ContainsAll returns true if this set contains all of the elements in the specified collection.
func (*HashSet[T]) Equals ¶ added in v0.3.0
Equals returns true if the specified collection is equal to this set.
func (*HashSet[T]) MarshalJSON ¶ added in v0.3.0
MarshalJSON implements json.Marshaler.
func (*HashSet[T]) Remove ¶ added in v0.3.0
Remove removes the specified element from this set, if it is present. Returns true if an element was removed.
func (*HashSet[T]) RemoveAll ¶ added in v0.3.0
RemoveAll removes all of this set's elements that are also contained in the specified collection. Returns true if this set changed as a result of the call.
func (*HashSet[T]) RetainAll ¶ added in v0.3.0
RetainAll retains only the elements in this set that are contained in the specified collection. Returns true if this set changed as a result of the call.
func (*HashSet[T]) Seq ¶ added in v0.3.0
Seq returns an iterator sequence over the elements in this set.
func (*HashSet[T]) Stream ¶ added in v0.3.0
func (this *HashSet[T]) Stream() Stream[T]
Stream returns a sequential Stream with this set as its source.
func (*HashSet[T]) ToSlice ¶ added in v0.3.0
func (this *HashSet[T]) ToSlice() []T
ToSlice returns a slice containing all elements in this set.
func (*HashSet[T]) UnmarshalJSON ¶ added in v0.3.0
UnmarshalJSON implements json.Unmarshaler.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package stream provides a lazy, thread-safe, expressive stream processing framework inspired by Java 8 streams and backed by Go iterators (iter.Seq).
|
Package stream provides a lazy, thread-safe, expressive stream processing framework inspired by Java 8 streams and backed by Go iterators (iter.Seq). |