Package org.eclipse.jgit.lib
Class FileModeCache.CacheItem
- java.lang.Object
-
- org.eclipse.jgit.lib.FileModeCache.CacheItem
-
- Enclosing class:
- FileModeCache
public static class FileModeCache.CacheItem extends java.lang.Object
An item from aFileModeCache
, recording information about a git path (known from context).
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,FileModeCache.CacheItem>
children
private FileMode
mode
-
Constructor Summary
Constructors Constructor Description CacheItem(FileMode mode)
Creates a newFileModeCache.CacheItem
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileModeCache.CacheItem
child(java.lang.String childName)
Retrieves an immediate child of thisFileModeCache.CacheItem
by name.FileMode
getMode()
Retrieves the cachedFileMode
.FileModeCache.CacheItem
insert(java.lang.String childName, FileMode childMode)
Inserts a new cachedFileMode
as an immediate child of thisFileModeCache.CacheItem
.FileModeCache.CacheItem
remove(java.lang.String childName)
Removes the immediate child with the given name.(package private) void
setMode(FileMode mode)
-
-
-
Field Detail
-
children
private java.util.Map<java.lang.String,FileModeCache.CacheItem> children
-
-
Constructor Detail
-
CacheItem
public CacheItem(@NonNull FileMode mode)
Creates a newFileModeCache.CacheItem
.- Parameters:
mode
-FileMode
to cache
-
-
Method Detail
-
child
public FileModeCache.CacheItem child(java.lang.String childName)
Retrieves an immediate child of thisFileModeCache.CacheItem
by name.- Parameters:
childName
- name of the child to get- Returns:
- the
FileModeCache.CacheItem
, ornull
if no such child is known
-
insert
public FileModeCache.CacheItem insert(java.lang.String childName, @NonNull FileMode childMode)
Inserts a new cachedFileMode
as an immediate child of thisFileModeCache.CacheItem
. If there is already a child with the same name, it is overwritten.- Parameters:
childName
- name of the child to createchildMode
-FileMode
to cache- Returns:
- the new
FileModeCache.CacheItem
created for the child
-
remove
public FileModeCache.CacheItem remove(java.lang.String childName)
Removes the immediate child with the given name.- Parameters:
childName
- name of the child to remove- Returns:
- the previously cached
FileModeCache.CacheItem
, if any
-
-