br.com.objectos.git
Class MutableBlob

java.lang.Object
  extended by br.com.objectos.git.MutableBlob
All Implemented Interfaces:
br.com.objectos.core.object.ToStringObject

public final class MutableBlob
extends Object

A class for creating an arbitrary blob object suitable for writing to a repository. It can be written to a repository directly or it can be written indirectly as an entry in a MutableTree instance.

Since:
2

Constructor Summary
MutableBlob(String name)
          Creates a new MutableBlob having the specified name.
 
Method Summary
 void formatToString(StringBuilder sb, int depth)
           
 EntryMode getMode()
          Returns the file mode of this tree entry.
 String getName()
          Returns the name of this tree entry.
 boolean hasName(String name)
          Returns true if this tree entry has the specified name, false otherwise.
 void setContents(Blob value)
          Sets the contents of this blob to be the same as the specified blob.
 void setContents(byte[] value)
          Sets the contents of this blob to the specified byte array.
 void setExecutable()
          Sets this blob's executable bit.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MutableBlob

public MutableBlob(String name)
Creates a new MutableBlob having the specified name.

Parameters:
name - the name of this blob when serving as a tree entry
Throws:
IllegalArgumentException - if name is an empty string
Since:
3
Method Detail

formatToString

public final void formatToString(StringBuilder sb,
                                 int depth)

getMode

public final EntryMode getMode()
Returns the file mode of this tree entry.

Returns:
the file mode of this tree entry

getName

public final String getName()
Returns the name of this tree entry.

Returns:
the name of this tree entry

setContents

public final void setContents(Blob value)
Sets the contents of this blob to be the same as the specified blob.

Parameters:
value - the new contents of this blob
Since:
3

setContents

public final void setContents(byte[] value)
Sets the contents of this blob to the specified byte array.

Parameters:
value - the new contents of this blob
Since:
3

setExecutable

public final void setExecutable()
Sets this blob's executable bit.


hasName

public final boolean hasName(String name)
Returns true if this tree entry has the specified name, false otherwise.

Parameters:
name - the value to test this entry's name against
Returns:
true if this tree entry has the specified name, false otherwise
Since:
3

toString

public final String toString()
Overrides:
toString in class Object


Copyright © 2020–2022 Objectos Software LTDA. All rights reserved.