-
Notifications
You must be signed in to change notification settings - Fork 52
io microsphere misc UnsafeUtils
Type: Class | Module: microsphere-java-core | Package: io.microsphere.misc | Since: 1.0.0
Source:
microsphere-java-core/src/main/java/io/microsphere/misc/UnsafeUtils.java
sun.misc.Unsafe Utility class
Take case to use those utility methods in order to the stability fo JVM
public abstract class UnsafeUtils extends BaseUtilsAuthor: Mercy
-
Introduced in:
1.0.0 -
Current Project Version:
0.3.16-SNAPSHOT
This component is tested and compatible with the following Java versions:
| Java Version | Status |
|---|---|
| Java 8 | ✅ Compatible |
| Java 11 | ✅ Compatible |
| Java 17 | ✅ Compatible |
| Java 21 | ✅ Compatible |
| Java 25 | ✅ Compatible |
Add the following dependency to your pom.xml:
<dependency>
<groupId>io.github.microsphere-projects</groupId>
<artifactId>microsphere-java-core</artifactId>
<version>${microsphere-java.version}</version>
</dependency>Tip: Use the BOM (
microsphere-java-dependencies) for consistent version management. See the Getting Started guide.
import io.microsphere.misc.UnsafeUtils;| Method | Description |
|---|---|
getLongFromArrayVolatile |
|
getIntFromArrayVolatile |
Get the value of the target Index in the object Array field |
getShortFromArrayVolatile |
Get the short value of the target Index in the Array field of the object |
getByteFromArrayVolatile |
Get the byte value of the target Index in the object Array field |
getBooleanFromArrayVolatile |
Get the boolean value of the target Index in the Array field of the object |
getDoubleFromArrayVolatile |
Get the double value of the target Index in the Array field of the object |
getFloatFromArrayVolatile |
Get the float value of the target Index in the object Array field |
getCharFromArrayVolatile |
Get the char value of the target Index in the object Array field |
getObjectFromArrayVolatile |
Get the java.lang.Object value of the target Index in the object Array field |
putDouble |
Sets the given double value to the field of the specified object |
putFloat |
Sets the given float value to the field of the specified object |
putShort |
Sets the given short value to the field of the specified object |
putByte |
Sets the given byte value to the field of the specified object |
putBoolean |
Sets the given boolean value to the field of the specified object |
putChar |
Sets the given char value to the field of the specified object |
putObject |
Sets the given Object value to the field of the specified object |
putLong |
Sets the given long value to the field of the specified object |
putInt |
Sets the given int value to the field of the specified object |
putOrderedInt |
Sets the given int value to the field of the specified object (ensures writing order) |
putOrderedLong |
Sets the given long value to the field of the specified object (ensures writing order) |
public static int getIntFromArrayVolatile(Object object, String fieldName, int index)Get the value of the target Index in the object Array field
public static short getShortFromArrayVolatile(Object object, String fieldName, int index)Get the short value of the target Index in the Array field of the object
public static byte getByteFromArrayVolatile(Object object, String fieldName, int index)Get the byte value of the target Index in the object Array field
public static boolean getBooleanFromArrayVolatile(Object object, String fieldName, int index)Get the boolean value of the target Index in the Array field of the object
public static double getDoubleFromArrayVolatile(Object object, String fieldName, int index)Get the double value of the target Index in the Array field of the object
public static float getFloatFromArrayVolatile(Object object, String fieldName, int index)Get the float value of the target Index in the object Array field
public static char getCharFromArrayVolatile(Object object, String fieldName, int index)Get the char value of the target Index in the object Array field
public static Object getObjectFromArrayVolatile(Object object, String fieldName, int index)Get the java.lang.Object value of the target Index in the object Array field
public static void putDouble(Object object, String fieldName, double value)Sets the given double value to the field of the specified object
public static void putFloat(Object object, String fieldName, float value)Sets the given float value to the field of the specified object
public static void putShort(Object object, String fieldName, short value)Sets the given short value to the field of the specified object
public static void putByte(Object object, String fieldName, byte value)Sets the given byte value to the field of the specified object
public static void putBoolean(Object object, String fieldName, boolean value)Sets the given boolean value to the field of the specified object
public static void putChar(Object object, String fieldName, char value)Sets the given char value to the field of the specified object
public static void putObject(Object object, String fieldName, Object value)Sets the given Object value to the field of the specified object
public static void putLong(Object object, String fieldName, long value)Sets the given long value to the field of the specified object
public static void putInt(Object object, String fieldName, int value)Sets the given int value to the field of the specified object
public static void putOrderedInt(Object object, String fieldName, int value)Sets the given int value to the field of the specified object (ensures writing order)
public static void putOrderedLong(Object object, String fieldName, long value)Sets the given long value to the field of the specified object (ensures writing order)
sun.misc.Unsafe
This documentation was auto-generated from the source code of microsphere-java.
annotation-processor
- ConfigurationPropertyAnnotationProcessor
- ConfigurationPropertyJSONElementVisitor
- FilerProcessor
- ResourceProcessor
java-annotations
java-core
- ACLLoggerFactory
- AbstractArtifactResourceResolver
- AbstractConverter
- AbstractDeque
- AbstractEventDispatcher
- AbstractLogger
- AbstractURLClassPathHandle
- AccessibleObjectUtils
- AdditionalMetadataResourceConfigurationPropertyLoader
- AnnotationUtils
- ArchiveFileArtifactResourceResolver
- ArrayEnumeration
- ArrayStack
- ArrayUtils
- Artifact
- ArtifactDetector
- ArtifactResourceResolver
- Assert
- BannedArtifactClassLoadingExecutor
- BaseUtils
- BeanMetadata
- BeanProperty
- BeanUtils
- ByteArrayToObjectConverter
- CharSequenceComparator
- CharSequenceUtils
- CharsetUtils
- ClassDataRepository
- ClassDefinition
- ClassFileJarEntryFilter
- ClassFilter
- ClassLoaderUtils
- ClassPathResourceConfigurationPropertyLoader
- ClassPathUtils
- ClassUtils
- ClassicProcessIdResolver
- ClassicURLClassPathHandle
- CollectionUtils
- Compatible
- CompositeSubProtocolURLConnectionFactory
- CompositeURLStreamHandlerFactory
- ConditionalEventListener
- ConfigurationProperty
- ConfigurationPropertyGenerator
- ConfigurationPropertyLoader
- ConfigurationPropertyReader
- Configurer
- ConsoleURLConnection
- Constants
- ConstructorDefinition
- ConstructorUtils
- Converter
- Converters
- CustomizedThreadFactory
- DefaultConfigurationPropertyGenerator
- DefaultConfigurationPropertyReader
- DefaultDeserializer
- DefaultEntry
- DefaultSerializer
- DelegatingBlockingQueue
- DelegatingDeque
- DelegatingIterator
- DelegatingQueue
- DelegatingScheduledExecutorService
- DelegatingURLConnection
- DelegatingURLStreamHandlerFactory
- DelegatingWrapper
- Deprecation
- Deserializer
- Deserializers
- DirectEventDispatcher
- DirectoryFileFilter
- EmptyDeque
- EmptyIterable
- EmptyIterator
- EnumerationIteratorAdapter
- EnumerationUtils
- Event
- EventDispatcher
- EventListener
- ExceptionUtils
- ExecutableDefinition
- ExecutableUtils
- ExecutorUtils
- ExtendableProtocolURLStreamHandler
- FastByteArrayInputStream
- FastByteArrayOutputStream
- FieldDefinition
- FieldUtils
- FileChangedEvent
- FileChangedListener
- FileConstants
- FileExtensionFilter
- FileUtils
- FileWatchService
- Filter
- FilterOperator
- FilterUtils
- FormatUtils
- Functional
- GenericEvent
- GenericEventListener
- Handler
- Handler
- HierarchicalClassComparator
- IOFileFilter
- IOUtils
- ImmutableEntry
- IterableAdapter
- IterableUtils
- Iterators
- JDKLoggerFactory
- JSON
- JSONArray
- JSONException
- JSONObject
- JSONStringer
- JSONTokener
- JSONUtils
- JarEntryFilter
- JarUtils
- JavaType
- JmxUtils
- ListUtils
- Listenable
- Lists
- Logger
- LoggerFactory
- LoggingFileChangedListener
- MBeanAttribute
- MBeanAttributeInfoBuilder
- MBeanConstructorInfoBuilder
- MBeanDescribableBuilder
- MBeanExecutableInfoBuilder
- MBeanFeatureInfoBuilder
- MBeanInfoBuilder
- MBeanNotificationInfoBuilder
- MBeanOperationInfoBuilder
- MBeanParameterInfoBuilder
- ManagementUtils
- ManifestArtifactResourceResolver
- MapToPropertiesConverter
- MapUtils
- Maps
- MavenArtifact
- MavenArtifactResourceResolver
- MemberDefinition
- MemberUtils
- MetadataResourceConfigurationPropertyLoader
- MethodDefinition
- MethodHandleUtils
- MethodHandlesLookupUtils
- MethodUtils
- ModernProcessIdResolver
- ModernURLClassPathHandle
- Modifier
- MultiValueConverter
- MultipleType
- MutableInteger
- MutableURLStreamHandlerFactory
- NameFileFilter
- NoOpLogger
- NoOpLoggerFactory
- NoOpURLClassPathHandle
- NumberToByteConverter
- NumberToCharacterConverter
- NumberToDoubleConverter
- NumberToFloatConverter
- NumberToIntegerConverter
- NumberToLongConverter
- NumberToShortConverter
- NumberUtils
- ObjectToBooleanConverter
- ObjectToByteArrayConverter
- ObjectToByteConverter
- ObjectToCharacterConverter
- ObjectToDoubleConverter
- ObjectToFloatConverter
- ObjectToIntegerConverter
- ObjectToLongConverter
- ObjectToOptionalConverter
- ObjectToShortConverter
- ObjectToStringConverter
- ObjectUtils
- PackageNameClassFilter
- PackageNameClassNameFilter
- ParallelEventDispatcher
- ParameterizedTypeImpl
- PathConstants
- Predicates
- Prioritized
- PriorityComparator
- ProcessExecutor
- ProcessIdResolver
- ProcessManager
- PropertiesToStringConverter
- PropertiesUtils
- PropertyConstants
- PropertyResourceBundleControl
- PropertyResourceBundleUtils
- ProtocolConstants
- ProxyUtils
- QueueUtils
- ReadOnlyIterator
- ReflectionUtils
- ReflectiveConfigurationPropertyGenerator
- ReflectiveDefinition
- ResourceConstants
- ReversedDeque
- Scanner
- SecurityUtils
- SeparatorConstants
- Serializer
- Serializers
- ServiceLoaderURLStreamHandlerFactory
- ServiceLoaderUtils
- ServiceLoadingURLClassPathHandle
- SetUtils
- Sets
- Sfl4jLoggerFactory
- ShutdownHookCallbacksThread
- ShutdownHookUtils
- SimpleClassScanner
- SimpleFileScanner
- SimpleJarEntryScanner
- SingletonDeque
- SingletonEnumeration
- SingletonIterator
- StackTraceUtils
- StandardFileWatchService
- StandardURLStreamHandlerFactory
- StopWatch
- StreamArtifactResourceResolver
- Streams
- StringBuilderWriter
- StringConverter
- StringDeserializer
- StringSerializer
- StringToArrayConverter
- StringToBlockingDequeConverter
- StringToBlockingQueueConverter
- StringToBooleanConverter
- StringToByteConverter
- StringToCharArrayConverter
- StringToCharacterConverter
- StringToClassConverter
- StringToCollectionConverter
- StringToDequeConverter
- StringToDoubleConverter
- StringToDurationConverter
- StringToFloatConverter
- StringToInputStreamConverter
- StringToIntegerConverter
- StringToIterableConverter
- StringToListConverter
- StringToLongConverter
- StringToMultiValueConverter
- StringToNavigableSetConverter
- StringToQueueConverter
- StringToSetConverter
- StringToShortConverter
- StringToSortedSetConverter
- StringToStringConverter
- StringToTransferQueueConverter
- StringUtils
- SubProtocolURLConnectionFactory
- SymbolConstants
- SystemUtils
- ThrowableAction
- ThrowableBiConsumer
- ThrowableBiFunction
- ThrowableConsumer
- ThrowableFunction
- ThrowableSupplier
- ThrowableUtils
- TrueClassFilter
- TrueFileFilter
- TypeArgument
- TypeFinder
- TypeUtils
- URLClassPathHandle
- URLUtils
- UnmodifiableDeque
- UnmodifiableIterator
- UnmodifiableQueue
- UnsafeUtils
- Utils
- ValueHolder
- Version
- VersionUtils
- VirtualMachineProcessIdResolver
- Wrapper
- WrapperProcessor
java-test
- AbstractAnnotationProcessingTest
- Ancestor
- AnnotationProcessingTestProcessor
- ArrayTypeModel
- CollectionTypeModel
- Color
- CompilerInvocationInterceptor
- ConfigurationPropertyModel
- DefaultTestService
- GenericTestService
- MapTypeModel
- Model
- Parent
- PrimitiveTypeModel
- SimpleTypeModel
- StringArrayList
- TestAnnotation
- TestService
- TestServiceImpl
jdk-tools
lang-model